{{{#!box important This page was a draft. See default [[wiki:/TicketQuery]] page now. }}} = !TicketQuery Wiki Macro = TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting. This macro accepts a comma-separated list of keyed parameters, in the form "key=value", and can be used as follows: `[[TicketQuery([key=value][,key=value][,key=value]...)]]` If the key is the name of a ticket field, the value must use the syntax of a filter specifier as defined in TracQuery#QueryLanguage. * Note that this is not the same as the simplified URL syntax used for query: links starting with a ? character. * Commas (,) can be included in field values by escaping them with a backslash (\). The date keys created and modified can also constrain the criteria. Again, see TracQuery#QueryLanguage. In addition to filters, several other named parameters can be used to control how the results are presented. All of them are optional. The date keys `created` and `modified` can also constrain the criteria. Again, see TracQuery#QueryLanguage. In addition to filters, several other named parameters can be used to control how the results are presented. All of them are optional. ||='''Key'''||='''Description & Details'''||='''Default'''|| ||=`col`=|| Pipe-separated list of columns and its order to show (requires `format=table`). || `col=id|summary`[[BR]]`|owner|type|`[[BR]]`status|priority`[[BR]]`|milestone` || ||=`desc`=|| Reverse (`true`) the natural display order of the tickets. || `desc=false` || ||=`format`^1^=|| Sets how to display the list of tickets:[[BR]] * `list` -- ticket `id` next to the `summary`, each ticket on a separate line.[[BR]] * `compact` -- comma-separated list of ticket `id`s.[[BR]] * `count` -- the count of matching tickets[[BR]] * `table` -- similar to the custom query view (but without the controls)[[BR]] * `progress` -- a view similar to the milestone progress bars. || `format=list` || ||=`group`=|| Sets the ticket field for grouping tickets. || `None` || ||=`groupdesc`=|| Reverse (`true`) the natural display order of the groups. || `groupdesc=false` || ||=`max`=|| Sets the limit number of tickets to display (`max=0` means no maximum). || `max=0` || ||=`order`=|| Sets the ticket field for ordering tickets. || `order=id` || ||=`rows`=|| Pipe-separated list of ticket fields to be viewed as a row, e.g. rows=description|summary (requires `format=table`) || `None` || ||=`verbose`=||Get the description for the listed tickets (`true`). Use with format=table only. Deprecated (< 0.12) in favor of the rows key. || `verbose=false` || Note ^1^ :: For compatibility with Trac 0.10, if there's a last positional parameter given to the macro, it will be used to specify the format. Note:: Also, for compatibility with Trac 0.10, using "&" as a field separator still works (except for order) but is deprecated. == Example == * Number of [query:status=new&milestone= Triage tickets]: '''[[TicketQuery(status=new&milestone=, count)]]''' * got with `[[TicketQuery(status=new&milestone=, count)]]` * Number of new tickets: '''[[TicketQuery(status=new, count)]]''' * got with `[[TicketQuery(status=new, count)]]` * Number of reopened tickets: '''[[TicketQuery(status=reopened, count)]]''' * got with `[[TicketQuery(status=reopened, count)]]` * Number of assigned tickets: '''[[TicketQuery(status=assigned, count)]]''' * got with `[[TicketQuery(status=assigned, count)]]` * Number of invalid tickets: '''[[TicketQuery(status=closed&resolution=invalid, count)]]''' * got with `[[TicketQuery(status=closed&resolution=invalid, count)]]` * Number of worksforme tickets: '''[[TicketQuery(status=closed&resolution=worksforme, count)]]''' * got with `[[TicketQuery(status=closed&resolution=worksforme, count)]]` * Number of duplicate tickets: '''[[TicketQuery(status=closed&resolution=duplicate, count)]]''' * got with `[[TicketQuery(status=closed&resolution=duplicate, count)]]` * Number of wontfix tickets: '''[[TicketQuery(status=closed&resolution=wontfix, count)]]''' * got with `[[TicketQuery(status=closed&resolution=wontfix, count)]]` * Number of fixed tickets: '''[[TicketQuery(status=closed&resolution=fixed, count)]]''' * got with `[[TicketQuery(status=closed&resolution=fixed, count)]]` * Total number of tickets in Trac is '''[[TicketQuery(status=new|assigned|reopened|closed, count)]]''' * got with `[[TicketQuery(status=new|assigned|reopened|closed, count)]]` * The last 5 modified tickets in Trac are: '''[[TicketQuery(max=5,modified=lastmonth..thismonth, ,desc=1,format=compact)]]''' and the very last one is detailed below:[[TicketQuery(max=1,modified=lastmonth..thismonth, ,desc=1,format=table,col=resolution|owner|reporter,rows=summary)]] * got with `[[TicketQuery(max=1,modified=lastmonth..thismonth, ,desc=1,format=table,col=resolution|owner|reporter,rows=summary)]]` ---- See also: TracQuery, TracTickets, TracReports, TracGuide