Trac Ticket Queries
Table of Contents
In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of criteria.
To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.
Filters
When you first go to the query page the default filter will display tickets relevant to you:
- If logged in then all open tickets it will display open tickets assigned to you.
- If not logged in but you have specified a name or email address in the preferences then it will display all open tickets where your email (or name if email not defined) is in the CC list.
- If not logged and no name/email defined in the preferences then all open issues are displayed.
Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the pulldown lists at the bottom corners of the filters box ('And' conditions on the left, 'Or' conditions on the right). Filters with either a text box or a pulldown menu of options can be added multiple times to perform an or of the criteria.
You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.
Once you've edited your filters click the Update button to refresh your results.
Navigating Tickets
Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.
You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.
The query results can be refreshed and cleared of these status indicators by clicking the Update button again.
Saving Queries
Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.
Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.
Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.
Using TracLinks
You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.
[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]
Which is displayed as:
This uses a very simple query language to specify the criteria (see Query Language).
Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:
[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]
Which is displayed as:
Using the [[TicketQuery]] Macro
The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.
Example:
[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]
This is displayed as:
- #41
- Add "Related" links to support forum posts
- #55
- Registration for Support Forums is in plain text (not checkbox)
- #128
- Mix of db table charsets causes bad output from Credits API
- #144
- Search support threads for a particular theme/plugin
- #154
- Trac is super narrow on Mobile Safari (iOS)
- #173
- Add ability to browse code reference
- #177
- Add cross referencing throughout code reference
- #179
- Create strong IA/hierarchy for code reference
- #190
- Restore attachments open by default on Core Trac
- #236
- Bullets in WordPress.org dropdown menus
- #241
- Forum Site rendered poorly on iOS
- #279
- responsive formatting hides page content below menu
- #301
- No cc field on meta.trac
- #315
- add search box to each plugin´s support forum to search within existing support threads only
- #357
- Add minimal support to the WordCamp Base theme to allow CSS overrides to be fully responsive
- #368
- Responsive
- #389
- Plugins: Approved email for hosting needs to be updated to reference https
- #414
- Support Forums Registration not case sensitive
- #415
- Update WordPress logo used in og:image element to improve social media distribution
- #438
- Mailing lists don't do HTTPS
- #444
- Layout of theme- and plugin-pages broken in smaller windows
- #454
- Code Reference: Source code links
- #462
- Responsive fixes for wordpress.org/mobile
- #480
- Require a support thread to be submitted when marking a plugin as "Broken"
- #483
- Mixed content warnings on theme pages cause preview to redirect to new page
- #494
- View all hooks available in a function
- #525
- User profile page: Permalinks for "Plugins" and another tabs
- #539
- Add search bar to interior pages on developer.wordpress.org
- #563
- Redirect phpdoc.wordpress.org
- #569
- Handbook: Bad character encoding in Trac article
- #570
- "WordPress Plugins » Most Popular" not working beyond page 99
- #587
- Invalid MIME Type at ps.w.org
- #597
- Display plugin icons on profile pages
- #608
- Redirect theme and plugin editor function reference to developer.wordpress.org
- #617
- Inaccessible Profile Icons Have No Text Alternative
- #641
- Display language download counts public
- #650
- Invalid Unicode characters at the bottom of Ticket Properties page
- #655
- Plugin name in Russian in readme.txt
- #657
- Search bar is not universally present
- #669
- Favicon is not optimized for retina/HD on wordpress.org
- #675
- Link to see whole file from patch
- #680
- Polyglots badge on validators profiles
- #722
- Add clickability/tooltip to profile badges
- #730
- the he.wordpress.org dashboard is in english
- #744
- Rate limit Slack mentions
- #759
- Keyboard shortcut causing Windows task manager to open
- #766
- Community calendar on make.wordpress.org for chats
- #770
- Increase the font size of input, select and textarea elements from 11px to 14px
- #817
- Add plugin version on forum threads
- #818
- Add plugin version to plugin reviews
- #856
- Double check filter results
- #884
- /wp-admin/options-general.php (compat.php on line 30)
- #906
- Reintroduce a link to the developer's theme demo
- #910
- Adding a way to "favorite" themes
- #930
- Theme Directory UI Update Feedback
- #931
- User plugin inconsistency
- #963
- Plugin directory: Missing pagination in certain search views
- #995
- Download stats API for locale versions
- #1000
- Emoji stripped from comments when edited on mobile
- #1013
- OpenGraph for Themes and Plugins
- #1022
- cyrillic characters not displaying properly in profiles activity
- #1033
- Floating description checkbox
- #1053
- Download stats shortcode for locale versions
- #1061
- Add a Git mirror for meta.svn.wordpress.org
- #1129
- Forums theme: Multiple current menu item carret highlights
- #1136
- Forums theme: Responsive design improvements for International Forums
- #1140
- "Pending" forum reply in stats, but not in topic
- #1159
- Latest Plugins
- #1168
- Prevent emails from being sent out before site is live
- #1176
- Kvetch! Not Loading Random
- #1180
- Add source code preview to the comment editor
- #1205
- Make BrowseHappy.com responsive
- #1221
- Broken anchor in Theme Developer Handbook
- #1222
- Default locale for translators
- #1227
- Trac: Add needs-screenshots to workflow keyboards
- #1244
- Inconsistent style.css references in Theme Directory strings
- #1249
- Add WPTV badge to dotorg user profiles
- #1264
- Localised plugin directory titles
- #1273
- Handbook chapters list doesn't collapse on small screens
- #1286
- An option to add new users to Rosetta sites without sending an invitation
- #1295
- Link from speaker-site doesn't work
- #1301
- Meta Trac Notifications
- #1316
- Display active installs for plugins on a user's profile page
- #1343
- Ability to put support topics on a quasy-resolved "awaiting reply" status
- #1345
- Handbook page revisions are broken
- #1348
- Plugin Translation Editors and duplicate statuses for the same string translation
- #1354
- Translation teams page shows the wrong contributors
- #1374
- Plugin Translation Editors are shown as if they are validator of core
- #1380
- Lost text without warning when click link in Trac without JavaScript enabled
- #1399
- Waiting strings are not automatically updated
- #1404
- Change how translate.wordpres.org works for Plugin and Theme developers
- #1410
- Zip Builder: generate uniform zip across all build machines
- #1420
- Toggle Comments doesnt work
- #1425
- Meta badge not added after receiving props
- #1432
- Text overflows for on "Create new Ticket" for components with really long names
- #1463
- Add 'ticket' to reserved terms for Trac mentions
- #1485
- Enable horizontal scroll for mobile devices on polyglots/teams page
- #1489
- Fixing i18n functions in make.w.org theme
- #1514
- Theme uploader: add step to confirm license before upload
- #1555
- Untranslated plurals are ignored in percentage complete calculations for translation projects
- #1583
- Oembed Endpoint
- #1588
- Update Plugin Repo Sidebar Links
- #1604
- Plugin Stats: Wrong data
- #1633
- theme card improvement
- #1663
- Phantom fuzzy strings in contributors table
- #1736
- Webservice/endpoint to fetch user profile plugins
- #1737
- Webservice/endpoint to fetch user profile badges
- #1765
- GlotPress import: Avoid overwriting current translations
- #1772
- Active versions: Total not reaching 100% and % sign missing
- #1832
- back-tick preformatted text in readme.txt not retaining line-breaks in beta plugin directory
- #1833
- Improve readability FAQ titles and answers
- #1835
- Plugin Directory: single plugin view -- add indicator when reviews got a response
- #1837
- Code blocks are reduced to one line
- #1838
- Improving plugin search
- #1844
- Approval Email Updated
- #1854
- Dates in translated plugin changelog are not displayed correctly
- #1871
- Broken navigation on bbPress 2.x profile
- #1879
- Rosetta: Local Team Page Template
- #1881
- https://ja.wordpress.org/support/topic/ permalink 404
- #1886
- Topic page layout broken on smaller screens
- #1895
- Cloud tags overlap the wrapped DIV and could overlap content text
- #1900
- Whitelist wordpress.org links in the number of links that force topic/reply moderation
- #1930
- Give General Translation Editors access to manually release translations
- #1969
- Locale team sites show "Login to Reply" although I'm logged in
- #2009
- There is a small bug in WordPress.org User Profile ( profiles.wordpress.org site )
- #2041
- Plugin Review 'link' to support is showing URL instead of linking.
- #2046
- Subscribe/unsubscribe actions not functioning
- #2067
- "Topics Started" shows only active topics
- #2075
- Plugin committer link not working anymore
- #2077
- Forum RSS feeds aren't linked in the header
- #2079
- Cannot mark a topic resolved when posting a comment
- #2092
- Many Google search results for wordpress questions are bringing up dead forum posts (404 Page not found)
- #2098
- Incorrect meeting date on Upcoming WordPress Meetings
Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language. This also allows displaying the link and description of a single ticket:
[[TicketQuery(id=123)]]
This is displayed as:
- #123
- Rename "Installation" tab on plugins details page
A more compact representation without the ticket summaries is also available:
[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]
This is displayed as:
#41, #55, #128, #144, #154, #173, #177, #179, #190, #236, #241, #279, #301, #315, #357, #368, #389, #414, #415, #438, #444, #454, #462, #480, #483, #494, #525, #539, #563, #569, #570, #587, #597, #608, #617, #641, #650, #655, #657, #669, #675, #680, #722, #730, #744, #759, #766, #770, #817, #818, #856, #884, #906, #910, #930, #931, #963, #995, #1000, #1013, #1022, #1033, #1053, #1061, #1129, #1136, #1140, #1159, #1168, #1176, #1180, #1205, #1221, #1222, #1227, #1244, #1249, #1264, #1273, #1286, #1295, #1301, #1316, #1343, #1345, #1348, #1354, #1374, #1380, #1399, #1404, #1410, #1420, #1425, #1432, #1463, #1485, #1489, #1514, #1555, #1583, #1588, #1604, #1633, #1663, #1736, #1737, #1765, #1772, #1832, #1833, #1835, #1837, #1838, #1844, #1854, #1871, #1879, #1881, #1886, #1895, #1900, #1930, #1969, #2009, #2041, #2046, #2067, #2075, #2077, #2079, #2092, #2098
Finally, if you wish to receive only the number of defects that match the query, use the count parameter.
[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]
This is displayed as:
133
Customizing the table format
You can also customize the columns displayed in the table format (format=table) by using col=<field> - you can specify multiple fields and what order they are displayed by placing pipes (|) between the columns like below:
[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]
This is displayed as:
Results (1 - 3 of 1563)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #2099 | invalid | Breathe: resolved-unresolved state accessibility | afercia | |
| #2098 | duplicate | Incorrect meeting date on Upcoming WordPress Meetings | johnbillion | |
| #2096 | fixed | Topic author gravatars should be requested as 100x100 pixel gravatars | netweb | netweb |
Full rows
In table format you can also have full rows by using rows=<field> like below:
[[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 1563)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #2099 | invalid | Breathe: resolved-unresolved state accessibility | afercia | |
| Description |
Absolutely new to Breathe, chiming in because this was reported in the Italian forums. The resolved/unresolved state is conveyed via a "border" (actually a CSS generated element background) color. Red or green. For accessibility, color alone is not sufficient to convey such an important information and it would need an additional indicator, a different shape or something like that. Worth reminding the most common form of color perception impairment is about green and reds. Also, I'm not 100% sure if it is actually used, but besides the red #e6000a I see some occurrences of red which translates to #ff0000 and when used against white under this red gives a contrast ratio under the 4.5:1 recommended by the WCAG level AA. |
|||
| #2098 | duplicate | Incorrect meeting date on Upcoming WordPress Meetings | johnbillion | |
| Description |
The next meeting time for the HTTPS & HTTP/2 Weekly Chat is at 16:00 GMT, which is 2h 40m from now. However, the 'Next Meeting' time for this meeting on https://make.wordpress.org/meetings/ is showing as next week (October 7th), despite the meeting time being set to 2016-09-30 at 16:00 (meeting link). |
|||
| #2096 | fixed | Topic author gravatars should be requested as 100x100 pixel gravatars | netweb | netweb |
| Description |
The content-single-topic-lead.php template requests 80x80 pixel gravatars (bbPress' default) for the topic author image which is then upscaled using CSS to 100x100 pixels Reply author gravatars are requested as 100x100 pixels, let's make gravatar requests the same size for both. |
|||
Query Language
query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values. To include a literal & or | in a value, escape the character with a backslash (\).
The available operators are:
| = | the field content exactly matches one of the values |
| ~= | the field content contains one or more of the values |
| ^= | the field content starts with one of the values |
| $= | the field content ends with one of the values |
All of these operators can also be negated:
| != | the field content matches none of the values |
| !~= | the field content does not contain any of the values |
| !^= | the field content does not start with any of the values |
| !$= | the field content does not end with any of the values |
The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be left out to avoid having to quote the query string.
| created=2007-01-01..2008-01-01 | query tickets created in 2007 |
| created=lastmonth..thismonth | query tickets created during the previous month |
| modified=1weekago.. | query tickets that have been modified in the last week |
| modified=..30daysago | query tickets that have been inactive for the last 30 days |
See also: TracTickets, TracReports, TracGuide
