How to create a Trac report of all tickets with file attachments
October 30th, 2013 by Scott McNab
You can find all Trac tickets containing attachments by doing the following steps:
- Go to “View Tickets”.
- After that, click “Create new report” (you must be logged in with TRAC_ADMIN privileges to see this button).
- Then enter a title and description e.g. “Show all attachments”
- Go in the SQL Query field and enter the following query and click “Save report”:
select * from attachment
- Now this will show you all attachments in the system including both wiki and ticket attachments. Alternatively to specifically view only ticket attachments use the following query:
select * from attachment where type = 'ticket'
Please note that as the ticket reporting system was not really designed to perform non-ticket related queries, the hyperlinks in the “Id” column will not link to wiki pages correctly. From the link text however you can still determine which wiki page the attachment is included on. However the links to tickets should be correct.