Plugin Directory

wiki:TicketQuery

TicketQuery Wiki Macro

The TicketQuery macro lets you display information on tickets within wiki pages. The query language used by the [[TicketQuery]] macro is described in 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.

Example

Example Result Macro
Number of Triage tickets: 1273 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 1273 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 10 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 89 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 117 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 79 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 217 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 87 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 1086 [[TicketQuery(status=closed,resolution=fixed,count)]]
Total number of tickets: 2958 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 14 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 0 [[TicketQuery(created=thismonth..,count)]]
Number of closed Firefox tickets: 2 [[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: 2 [[TicketQuery(status=closed,keywords~=firefox|opera,count)]]
Number of tickets that affect Firefox or are closed and affect Opera: 4 [[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: #2975, #2974, #2973 [[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 anonymous
Summary Just a test

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:

#191
Contact Form issues
#266
not getting comments sent using form
#269
Label for textarea is wrong
#281
Browser Compatibility
#316
I'm getting all kinds of spam from this plugin
#324
Receiving bogus e-mails via wp-contact form
#326
Message about save mode when sending
#329
emails not arriving from contact form at http://209.193.111.155/?page_id=5
#346
Open in New window ?
#360
WP-contactform Layout is Broken
#381
WP-Contact-Form not working on Yahoo hosting
#383
Spamming via wp-contact-form
#398
Problem with layout in IE
#511
Revamp the options
#618
Meta Widget Links to Wordpress.com
#673
Ajaxify/J-script a post-series listing
#810
Allow user to control the location of the series table of contents box in their post.
#828
Widget for posts in series
#878
Subscribe to All Comments
#1175
Encoding issue with version 4
#1341
Jetpack conflicts with plugin custom content types
#1632
Custom Post Types with 'exclude_from_search' set to true do not show titles in Stats
#1646
Reflective/Stored XSS in Responsive Logo Slideshow Plugin
#1655
Jetpack's Carousel has a logical issue in wp_get_attachment_link filter
#1687
Contact Form CSS has widget CSS that can interfere with other plugins
#1703
Update Facebook logos in Sharedaddy
#1709
Allow activate/deactivate subscription emails per post
#1713
Google Maps shortcode: iFrame code is not automatically transformed into the shortcode
#1726
Add Sharedaddy sharing buttons to Carousel
#1727
Allow Publicize to LinkedIn Company Pages
#1735
Using the same field names on a Contact form causes only the 2nd one to be displayed in the Feedbacks
#1736
Contact form: handle square brackets in input fieds
#1740
Allow Post By Email to Custom post Types
#1744
Jetpack: PHP warning for non-static method in `Jetpack_User_Agent_Info::is_ipad()`
#1748
Notifications trigger an HTTPS warning in IE
#1750
Jetpack stats
#1758
Allow adding Sharing buttons to the Tiled Gallery - Slideshow
#1762
Contact form: cannot insert a form using do_shortcode
#1764
Language settings cannot be altered by language plugins
#1766
Photon doesn't recognize images using a filename similar to WordPress' default resized images
#1768
Jetpack's jQuery Spin conflicts with Mootools' Spinner
#1770
Contact Form: add an optgroup option when using dropdowns
#1774
Subscriptions: include Follow button for logged out users
#1777
add LinkedIn Comments login options
#1779
Allow more than one contact form per page
#1780
Comment subscriptions: allow readers to subscribe without leaving a comment
#1783
Carousel / Photon: when resizing the browser, Photon doesn't update the queried image
#1785
Publicize: allow users to create Publicize excerpt templates
#1795
Omnisearch: support all public Custom Post Types by default
#1797
Top Posts & Pages widget: add an option to display only posts
#1798
Top Posts widget: overlay title on image format
#1803
Twitter Timeline: Allow for Auto in Width Specifications
#1807
Jetpack Comments: add an option to log in to self-hosted WP account
#1810
Contact Form: allow users to upload media via the form
#1811
Facebook Like Box widget: increase the max-width
#1812
Widgets: add a Google+ badge widget
#1815
Tiled Galleries: Alt Text is removed when Tiled galleries are enabled
#1816
Carousel: Add copyright information to the image metadata
#1817
Sharing: Allow for comments along the Likes when using Facebook's Official Like button
#1820
Comment form in Opera Mini doesn't show the email and name fields nor the Submit button
#1821
Publicize to Tumblr doesn't publish Photosets
#1824
Sharing: use Socialite.js to lazy load all sharing buttons
#1825
Custom CSS: add support for -webkit-mask-image
#1826
Serve all Jetpack js files through Photon/WP.com
#1829
Image Widget: pull images from Media Library
#1830
Stats - error: array_intersect() [function.array-intersect] in stats.php, line 117
#1831
Comments form: allow changes to wording (styles) to Comment subscriptions in iframe
#1833
Shortcodes: slideshow-shortcode.js uses ? for URL parameters when & is correct
#1834
Featured Content: add a new parameter to Featured Content to allow users to include Featured Posts in the main blog query
#1840
After the Deadline: enable spellcheck by default
#1842
Publicize: conflict with the Duplicate Post plugin
#1844
Sharing: improvements to the "More" dropdown
#1846
MP6: Navigation menu is not sticky when in the Jetpack menu
#1847
Slideshow Shortcode: add a parameter to control the transition speed
#1848
Stats: Show Sharing stats like on WordPress.com
#1849
Email subscriptions: Send email to site owner when the site gets a new email subscriber
#1850
Contact Form: Include a dashboard notification for new Feedback
#1854
Tiled Galleries: "Links to:" options not respected
#1857
Sharing button: the spacing is uneven
#1861
Sharing: add a Facebook Send button
#1868
Sharing / Likes: conflict with the Basic Google Maps Placemarks plugin
#1869
Audio Shortcode: fallback to Jetpack's player for playlists
#1874
Sharing: add Buffer to the list of available services
#1875
Sharing: Official Google+ is not loaded when loading more posts through Infinite Scroll
#1880
Contact Forms: add Captcha Support
#1881
Sharing / Publicize: Open Graph protocol - add post publish, modify, author
#1882
After the Deadline: better wording needed for the AtD prompt
#1885
Photon: do not apply Photon when doing an AJAX request in the admin
#1886
After the Deadline: Mixed content warnings when using SSL on admin
#1887
Publicize: add support for App.net
#1888
Contact Form: all customization of the subject line, for each submitted form
#1889
Jetpack Open Graph Description wasn't capitalizing P in WordPress
#1890
Sharing: localized string is missing from .pot file
#1892
Jetpack Comments / Subscriptions: offer option to preselect subscription options
#1893
Publicize: Add support for Custom Post Types
#1895
Likes: Like notifications sent to the blog owner instead of the post author
#1903
Contact Form: Emails are sent as plain text
#1904
Widget Visibility : add "Logged In/Out" Test to conditions
#1921
Stats: Respect the DNT (Do not Track) header
#1924
Comments: add RTL support
#1926
Upgrade: Some modules are not activated
#1927
Use publicize info or allow users to customise twitter:site og tag
#1928
Use namespacing in custom post types to avoid conflicts
#1930
Publicize: publicized posts are posted from a "WordPress.com" app instead of a "Jetpack" app
#1931
Reveal the WordPress.com account associated with a blog
#1932
Publicize: posts to Tumblr losing extra whitespace.
#1933
Publicize: iframe code is being removed
#1934
Photon: full image size can still have dimension parameters
#1935
Audio Shortcode: Including options causes the player to break
#1937
Subscriptions: include CPTs
#1939
Post by Email - Add alt text for images
#1943
Top Posts & Pages Widget: Add alt tags to images
#1946
Sharing / Publicize: Open Graph protocol - default value of website
#1949
(SVN commit ) I can not update the plugin
#1951
Show the stats chart in the admin bar in the Dashboard
#1959
Open Graph: og:url set improperly with previously static homepages
#1962
Widget Visibility: choosing the "Page Name" rather than Posts page
#1963
Options in Hebrew comment field should be aligned to the right
#1966
Tiled Galleries: jQuery mouseover caption incorrectly stacks tweens
#1968
Jetpack Comments: "Submitting comment" message appears twice, once localized, once not
#1969
Contact Form: add a redirect option
#1973
Sharing: Official Digg button throws a javascript error
#1974
Sharing: Notice when the sharing label value is not set
#1975
Widget Visibility: add custom taxonomy and CPT support
#1977
Carousel: add the number of comments to the info box on the right side of the carousel view
#1978
Subscriptions: Cancel pending subscriptions after a certain length of time
#1979
Widget visibility: code assumes the a -number on the end of the widget name
#1980
Publicize: image missing from post publicized on Path
#1982
Widget Visibility: add option to display a widget only for a specific search term result page
#1983
Widget Visibility: add option to display a widget only for a specific search term result page
#1984
Grunion: Activating jetpack in a subsite in a multisite setup deactivates Grunion if activated network-wide
#1986
Widget visibility: allow the use of both "Show" and "Hide" for the same widget
#1987
Widget Visibility: add an AND condition
#1989
Widget Visibility: widget should not appear on paginated home page
#1991
Carousel: layout breaks on mobile when device is rotated
#1998
Widget Visibility: add user role condition
#1999
Custom CSS: show_all_rev doesn't return all revisions anymore
#2000
Infinite Scroll: infinite-scroll class should be added by JS, not PHP
#2001
Twitter Timeline Widget does not respect height setting
#2006
Unnecessary title attributes
#2007
Stats: hide the sparkline on mobile
#2008
Random Redirect: add back random_cat_id and random_post_type
#2010
Contact form: Uninitialized string notice
#2015
Infinite Scroll: cannot go back to Page 1
#2016
Sharing: add vk.com to the list of services
#2019
Show which users on a site have connected to WordPress.com to view stats, receive notifications, etc.
#2021
Add a Geolocation module to Jetpack
#2022
When Jetpack is deactivated, we should detect active widgets and warn
#2026
Stats: Detailed post stats page is broken with WooCommerce Active
#2027
Contact Form: add an "Empty Spam" option
#2028
Sharing: change how resources are loaded to allow for defer loading
#2031
devicepx: improve layout thrashing potential in Jetpack
#2032
Likes: change how resources are loaded to allow for defer loading
#2036
Carousel RTL: Comment prompt is not aligned to the right
#2038
Shortcodes: Soundcloud shortcode always uses HTTP, never HTTPS
#2039
Stats: add a bar graph next to each post on the Posts > All Posts screen
#2041
Jetpack: add a check to see if ignore_user_abort is enabled
#2042
Carousel: avoid use of !important to allow themes to overwrite fonts in the Carousel view
#2043
Custom CSS: custom $content_width value doesn't overwrite theme's $content_width
#2044
Post By Email: Password shortcode has no effect
#2045
Subscriptions / Stats: add tracking to notification emails
#2047
Dev mode: add notice at the top of the Jetpack menu
#2048
Publicize to Tumblr should respect post format
#2050
Widget Visibility: improve compatibility with bbPress' Forums root
#2051
Shortcodes: [Bandcamp Module] Bug about album id
#2052
Twitter Cards: handle plugin conflicts separately from OG tags
#2055
Requesting the ability to set post format when posting by email.
#2057
Subscriptions: allow site owners to remove email addresses from the subscription list
#2062
Photon: filenames including 3 dashes return an error
#2063
Widget visibility: is_active_sidebar always returns true
#2066
Google Authorship: doesn't support apostrophe in Author Name on Settings -> Sharing page
#2068
Sharing: allow sharing buttons to be displayed on Custom Post Type index pages
#2070
Tiled Galleries: add pagination support
#2071
Carousel: Javascript error in IE10
#2076
Subscriptions: Cannot see site followers when Site Stats is disabled.
#2077
Jetpack Comments: comment submission blocked on site accessed via HTTPS
#2078
Widget Visibility: add media query conditions
#2079
Contact Form: add bubble notification of new messages in dashboard
#2087
Publicize: G+ adds a "Continue reading →" if the post has an excerpt
#2088
Sharing / Mobile Theme: 2 Textdomains missing context/ context translation function
#2089
i18n: unify wrong textdomains beside "jetpack" to only use "jetpack"
#2090
Javascripts from WordPress.com CDN
#2108
Jetpack: AtD TinyMCE 4.0
#2112
Link plugin for TinyMCE
#2115
Editable images and captions
#2116
Update category and tags classes when they're changed
#2118
Post Locking
#2119
Support custom post types
#2121
RTL
#2122
HTML comments should be visible
#2125
Add temporary category to auto-draft
#2127
46px adminbar for small screens
#2129
Returning to back-end post editor returns wrong post
#2130
Make images editable
#2131
TinyMCE toolbar UI
#2132
Edits not saving
#2134
Consideration of structural elements
#2142
Use an edit endpoint for the front page, not ?editing
#2143
Link to the front-end editor on the back-end should not update a published post
#2144
TinyMCE: Allow customization
#2145
After the Deadline: update autosave handling
#2147
Translate English and Arabic
#2152
Jetpack: missing closing div for Recent Posts widget output when no posts are returned
#2157
No formatting toolbar on mobile
#2165
Spell checker
#2187
Jetpack: URL expander & GET param preservation
#2192
Tinymce violation of license term: source is only available as concatenation and not as prefered form of modification
#2194
Hi
#2317
WordPress Importer: WXR_Parser_Regex adds newlines to import data, breaking serialized post meta.
#2482
Password stopping me from using plug-in
#2484
I have a wordpress account! The correct password I enter into my account and this message pops up saying it is incorrect!
#2626
Importing: Adapt blessed plugin to support for PHP7.x
#2654
Support for InnoDB with full-text index
#2674
Function Fixes
#2708
There's no need to check is_ssl() because home_url() contains it in itself
#2772
Improve Styling for "Health Check & Troubleshooting" for a better accessibility
#2820
Ability to customize Manage Signups page in admin

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 displays the link and description of a single ticket:

[[TicketQuery(id=123)]]

This is displayed as:

#123
wp-contact-form conflicts with adsense plugin

A more compact representation without the ticket summaries is:

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

This is displayed as:

#191, #266, #269, #281, #316, #324, #326, #329, #346, #360, #381, #383, #398, #511, #618, #673, #810, #828, #878, #1175, #1341, #1632, #1646, #1655, #1687, #1703, #1709, #1713, #1726, #1727, #1735, #1736, #1740, #1744, #1748, #1750, #1758, #1762, #1764, #1766, #1768, #1770, #1774, #1777, #1779, #1780, #1783, #1785, #1795, #1797, #1798, #1803, #1807, #1810, #1811, #1812, #1815, #1816, #1817, #1820, #1821, #1824, #1825, #1826, #1829, #1830, #1831, #1833, #1834, #1840, #1842, #1844, #1846, #1847, #1848, #1849, #1850, #1854, #1857, #1861, #1868, #1869, #1874, #1875, #1880, #1881, #1882, #1885, #1886, #1887, #1888, #1889, #1890, #1892, #1893, #1895, #1903, #1904, #1921, #1924, #1926, #1927, #1928, #1930, #1931, #1932, #1933, #1934, #1935, #1937, #1939, #1943, #1946, #1949, #1951, #1959, #1962, #1963, #1966, #1968, #1969, #1973, #1974, #1975, #1977, #1978, #1979, #1980, #1982, #1983, #1984, #1986, #1987, #1989, #1991, #1998, #1999, #2000, #2001, #2006, #2007, #2008, #2010, #2015, #2016, #2019, #2021, #2022, #2026, #2027, #2028, #2031, #2032, #2036, #2038, #2039, #2041, #2042, #2043, #2044, #2045, #2047, #2048, #2050, #2051, #2052, #2055, #2057, #2062, #2063, #2066, #2068, #2070, #2071, #2076, #2077, #2078, #2079, #2087, #2088, #2089, #2090, #2108, #2112, #2115, #2116, #2118, #2119, #2121, #2122, #2125, #2127, #2129, #2130, #2131, #2132, #2134, #2142, #2143, #2144, #2145, #2147, #2152, #2157, #2165, #2187, #2192, #2194, #2317, #2482, #2484, #2626, #2654, #2674, #2708, #2772, #2820

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:

217

A graphical use of the macro is with the format=progress attribute:

[[TicketQuery(milestone=0.12.8&group=type,format=progress)]]

For example for one of the upcoming milestones, bars are shown by ticket type:

defect

1050 / 2025

enhancement

463 / 815

task

73 / 118


See also: TracQuery, TracTickets, TracReports, TracGuide

Last modified 8 years ago Last modified on 03/30/2018 08:39:37 PM