Version 1 (modified by trac, 3 months ago) ( diff )


TicketQuery Wiki Macro

The TicketQuery macro lets you display ticket information anywhere that accepts WikiFormatting. The query language used by the [[TicketQuery]] macro is described in the TracQuery page.



Wiki macro listing tickets that match certain criteria.

This macro accepts a comma-separated list of keyed parameters, in the form "key=value".

If the key is the name of a 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 (\).

Groups of field constraints to be OR-ed together can be separated by a literal or argument.

In addition to filters, several other named parameters can be used to control how the results are presented. All of them are optional.

The format parameter determines how the list of tickets is presented:

  • list -- the default presentation is to list the ticket ID next to the summary, with each ticket on a separate line.
  • compact -- the tickets are presented as a comma-separated list of ticket IDs.
  • count -- only the count of matching tickets is displayed
  • rawcount -- only the count of matching tickets is displayed, not even with a link to the corresponding query (since 1.1.1)
  • table -- a view similar to the custom query view (but without the controls)
  • progress -- a view similar to the milestone progress bars

The max parameter can be used to limit the number of tickets shown (defaults to 0, i.e. no maximum).

The order parameter sets the field used for ordering tickets (defaults to id).

The desc parameter indicates whether the order of the tickets should be reversed (defaults to false).

The group parameter sets the field used for grouping tickets (defaults to not being set).

The groupdesc parameter indicates whether the natural display order of the groups should be reversed (defaults to false).

The verbose parameter can be set to a true value in order to get the description for the listed tickets. For table format only. deprecated in favor of the rows parameter

The rows parameter can be used to specify which field(s) should be viewed as a row, e.g. rows=description|summary

The col parameter can be used to specify which fields should be viewed as columns. For table format only.

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. Also, using "&" as a field separator still works (except for order) but is deprecated.


Example Result Macro
Number of Triage tickets: 135 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 154 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 1 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 0 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 60 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 0 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 51 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 78 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 632 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 231 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 1432 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 0 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 0 [[TicketQuery(created=thismonth..,count)]]
Number of closed Firefox tickets: 0 [[TicketQuery(status=closed,keywords~=firefox,count)]]
Number of closed Opera tickets: 0 [[TicketQuery(status=closed,keywords~=opera,count)]]
Number of closed tickets affecting Firefox and Opera: 0 [[TicketQuery(status=closed,keywords~=firefox opera,count)]]
Number of closed tickets affecting Firefox or Opera: 0 [[TicketQuery(status=closed,keywords~=firefox|opera,count)]]
Number of tickets that affect Firefox or are closed and affect Opera: 0 [[TicketQuery(status=closed,keywords~=opera,or,keywords~=firefox,count)]]
Number of closed Firefox tickets that don't affect Opera: 0 [[TicketQuery(status=closed,keywords~=firefox -opera,count)]]
Last 3 modified tickets: #5631, #5612, #417 [[TicketQuery(max=3,order=modified,desc=1,compact)]]

Details of ticket #1:


Ticket Owner Reporter
#1 Matt Lee Will Kahn-Greene
Summary create user accounts in moveable type

Format: list


This is displayed as:

User-defined galleries
Enable "favoriting" of media
Display number of views a media object has had
Presentation and/or document media type support?
Make license options customizable and drop non-FaiF options by default
Localized dates and times
Make it easier to download the published audio file
Add download link to audio media type
Tests fail because of audio metadata table
Use OpenWebFonts
Internationalization sets the language used in the comment notification email template
allow to register to let comment on my cat pics
Need better PuSH mechanism
Collections can only be found from a file's page, no list to be found
Sharing of private collections
When name of upload conflicts with existing media, mg uses the id number, but does not check whether an exisiting item is named that.
Need a list of "Tests for Humans"
Video thumbnails are not created
Allow to embed GNU Mediagoblin player in a web page
I tried send comment and got -> Server Error
Visual indication of media type on gallery page thumbnails
Problem with one special jpg
File upload size limited by available system memory
Data liberation
Thumbnails in the collection view are missing file title
Uploading images by drag&drop
Deleting media causes feed API issue
Upload audio to GNU MediaGoblin via the API
Typo in mediagoblin.pot
Errors in translations
gi warnings
Hard-coded absolute URL path in frontpage_welcome.html
Install Scripts Shebang on Freebsd
Particular PDF not uploading
Bug in media types extension parsing
Number of views does not exist for media
PDF processing fails on non-ASCII characters in extract_pdf_info
Tests failing in current master
Audio submission test fails with
Compiling error involving babel an localedata
migration will fail when disable a previously enabled plugin
Never ends processing
Adding the Peer Production License as one option more when submitting content
0.9.0 pdf fails: No plugins using two-step checking found
misleading messages uploading PDFs: No plugins using two-step checking found (0.9.0)
Show log messages for failed uploads in Media processing panel
ValueError when trying to submit media
Avoiding up-scaling low-res videos
Hook up lightbox effect for images
Doc update - pyexiv2


This is displayed as:

We need a margin between the media image and the sidebar

Format: compact

[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]

This is displayed as:

#278, #292, #334, #391, #395, #408, #446, #449, #455, #493, #504, #525, #547, #559, #609, #631, #656, #717, #726, #769, #784, #825, #834, #892, #929, #937, #995, #1038, #1074, #1101, #5020, #5035, #5306, #5312, #5335, #5336, #5337, #5348, #5358, #5362, #5384, #5453, #5461, #5479, #5497, #5498, #5499, #5557, #5591, #5606, #5622

Format: count

[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]

This is displayed as:


Format: progress


This is displayed as:

Format: table

You can choose the columns displayed in the table format (format=table) using col=<field>. You can specify multiple fields and the order they are displayed by placing pipes (|) between the columns:


This is displayed as:

Results (1 - 3 of 1168)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#5631 invalid this is a test Ben Sturmfels
#5627 fixed Generalise keyboard navigation Olivier Mehani
#5626 fixed Upgrade issue from 0.10 to 0.11 TmCTux
1 2 3 4 5 6 7 8 9 10 11

Full rows

In table format you can specify full rows using rows=<field>:


This is displayed as:

Results (1 - 3 of 1168)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#5631 invalid this is a test Ben Sturmfels
#5627 fixed Generalise keyboard navigation Olivier Mehani

The media display pages allow to use the left and right arrows to navigate between media.

The patch at generalises this for other pages, such as galleries.

This commit is part of my work on #5619, which is still a WIP. However, this particular change should be good to go.

#5626 fixed Upgrade issue from 0.10 to 0.11 TmCTux

following the upgrade guide (and the installation guide just in case), I've encounter the following issue during upgrade:

1) after launching this command: ./ && VIRTUALENV_FLAGS='--system-site-packages' ./configure && make

it fails during setup saying idna3.2 is installed (as one package require >2 and it picks the last available) but a later one require < 3 (this could be removed because python2 support has been dropped).

workaround was: ./bin/pip uninstall idna ./bin/pip install idna==2.10 and relaunch the last step: ./bin/python develop --upgrade and continue the rest of the upgrade process: make

2) on the last upgrade process we have to upgrade the db: ./bin/gmg dbupdate this fails because jsonschema.compat is not found

workaround: commenting the import from the following file mediagoblin/tools/

and now the gmg dbupdate works.

YMMV but that's what happend for me on buster 10.10 on 5th july 2021. (date can be important due to external nodejs dependency) - and it is only reported now as the trac seemed to have been broken for a while (on my side at least).

thanks again for this new release, works quite well so far!

1 2 3 4 5 6 7 8 9 10 11

See also: TracQuery, TracTickets, TracReports

Note: See TracWiki for help on using the wiki.