close Warning: Can't synchronize with repository "(default)" (/common/SVN/crkit does not appear to be a Subversion repository.). Look in the Trac log for more information.

Changes between Version 1 and Version 2 of TicketQuery


Ignore:
Timestamp:
Jan 30, 2019, 11:46:21 PM (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TicketQuery

    v1 v2  
    11= !TicketQuery Wiki Macro
    22
    3 The !TicketQuery macro lets you display ticket information anywhere that accepts WikiFormatting.
    4 The query language used by the `[[TicketQuery]]` macro is described in the [TracQuery#QueryLanguage TracQuery] page.
     3The !TicketQuery macro lets you display information on tickets within wiki pages.
     4The query language used by the `[[TicketQuery]]` macro is described in [TracQuery#UsingtheTicketQueryMacro TracQuery] page.
    55
    66== Usage
     
    88[[MacroList(TicketQuery)]]
    99
    10 == Examples
     10== Example
    1111
    1212||= **Example** =||= **Result** =||= **Macro** =||
     
    4848|| `[[TicketQuery(status=closed,resolution=fixed,count)]]` ||
    4949|-----------------------------------------------------------
    50 ||=Number of untriaged tickets (milestone unset): =||\
    51 || **[[TicketQuery(status!=closed,milestone=,count)]]**||\
    52 || `[[TicketQuery(status!=closed,milestone=,count)]]` ||
    53 |-----------------------------------------------------------
    5450||=Total number of tickets: =||\
    5551|| **[[TicketQuery(count)]]**||\
     
    6359|| **[[TicketQuery(created=thismonth..,count)]]**||\
    6460|| `[[TicketQuery(created=thismonth..,count)]]` ||
    65 |-----------------------------------------------------------
    66 ||=Number of closed Firefox tickets: =||\
    67 || **[[TicketQuery(status=closed,keywords~=firefox,count)]]**||\
    68 || `[[TicketQuery(status=closed,keywords~=firefox,count)]]` ||
    69 |-----------------------------------------------------------
    70 ||=Number of closed Opera tickets: =||\
    71 || **[[TicketQuery(status=closed,keywords~=opera,count)]]**||\
    72 || `[[TicketQuery(status=closed,keywords~=opera,count)]]` ||
    73 |-----------------------------------------------------------
    74 ||=Number of closed tickets affecting Firefox and Opera: =||\
    75 || **[[TicketQuery(status=closed,keywords~=firefox opera,count)]]**||\
    76 || `[[TicketQuery(status=closed,keywords~=firefox opera,count)]]` ||
    77 |-----------------------------------------------------------
    78 ||=Number of closed tickets affecting Firefox or Opera: =||\
    79 || **[[TicketQuery(status=closed,keywords~=firefox|opera,count)]]**||\
    80 || `[[TicketQuery(status=closed,keywords~=firefox|opera,count)]]` ||
    81 |-----------------------------------------------------------
    82 ||=Number of tickets that affect Firefox or are closed and affect Opera: =||\
    83 || **[[TicketQuery(keywords~=firefox,or,status=closed,keywords~=opera,count)]]**||\
    84 || `[[TicketQuery(status=closed,keywords~=opera,or,keywords~=firefox,count)]]` ||
    85 |-----------------------------------------------------------
    86 ||=Number of closed Firefox tickets that don't affect Opera: =||\
    87 || **[[TicketQuery(status=closed,keywords~=firefox - opera,count)]]**||\
    88 || `[[TicketQuery(status=closed,keywords~=firefox -opera,count)]]` ||
    8961|-----------------------------------------------------------
    9062||=Last 3 modified tickets: =||\
     
    10678|-----------------------------------------------------------
    10779
    108 === Format: list
     80== Using the `[[TicketQuery]]` Macro
    10981
     82The [trac:TicketQuery TicketQuery] macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.
     83
     84Example:
    11085{{{
    11186[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]
     
    11590  [[TicketQuery(version=0.6|0.7&resolution=duplicate)]]
    11691
     92Just like the [wiki:TracQuery#UsingTracLinks query: wiki links], the parameter of this macro expects a query string formatted according to the rules of the simple [wiki:TracQuery#QueryLanguage ticket query language]. This also displays the link and description of a single ticket:
    11793{{{
    11894[[TicketQuery(id=123)]]
     
    12298  [[TicketQuery(id=123)]]
    12399
    124 === Format: compact
    125 
     100A more compact representation without the ticket summaries is:
    126101{{{
    127102[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]
     
    131106  [[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]
    132107
    133 === Format: count
    134 
     108If you wish to receive only the number of defects that match the query, use the `count` parameter:
    135109{{{
    136110[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]
     
    140114  [[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]
    141115
    142 === Format: progress
    143 
     116A graphical use of the macro is with the `format=progress` attribute:
    144117{{{
    145118[[TicketQuery(milestone=0.12.8&group=type,format=progress)]]
    146119}}}
    147120
    148 This is displayed as:
    149   [[TicketQuery(milestone=0.12.8&group=type,format=progress)]]
    150 
    151 === Format: table
    152 
    153 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:
    154 {{{
    155 [[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]
    156 }}}
    157 
    158 This is displayed as:
    159 [[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]
    160 
    161 ==== Full rows
    162 
    163 In ''table'' format you can specify full rows using `rows=<field>`:
    164 {{{
    165 [[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]
    166 }}}
    167 
    168 This is displayed as:
    169 [[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]
     121For example for one of the upcoming milestones, bars are shown by ticket type:
     122[[TicketQuery(milestone=0.12.8&group=type,format=progress)]]
    170123
    171124----
    172 See also: TracQuery, TracTickets, TracReports
     125See also: TracQuery, TracTickets, TracReports, TracGuide