wiki:TicketQuery

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.

Usage

[[TicketQuery]]

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.

Examples

Example Result Macro
Number of Triage tickets: 133 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 152 [[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: 52 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 78 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 636 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 227 [[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: #5482, #5558, #5574 [[TicketQuery(max=3,order=modified,desc=1,compact)]]

Details of ticket #1:

[[TicketQuery(id=1,col=id|owner|reporter,rows=summary,table)]]

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

Format: list

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

This is displayed as:

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

[[TicketQuery(id=123)]]

This is displayed as:

#123
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, #5574, #5591, #5606, #5622

Format: count

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

This is displayed as:

52

Format: progress

[[TicketQuery(milestone=0.12.8&group=type,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:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Results (1 - 3 of 1173)

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>:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 1173)

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
Description

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

The patch at https://scm.narf.ssji.net/git/mediagoblin/patch/?id=1ba9ee46e56e6c77aab964c19de07c6d34d933ee 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
Description

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

1) after launching this command: ./bootstrap.sh && 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 setup.py 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/metadata.py

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

Last modified 20 months ago Last modified on Mar 23, 2023, 6:44:37 AM
Note: See TracWiki for help on using the wiki.