wiki:TicketQuery

Version 2 (modified by trac, 2 years 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.

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: 0 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 6 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 0 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 0 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 12 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 9 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 4 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 33 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 187 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 0 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 251 [[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: #251, #250, #249 [[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 somebody huub
Summary ntpd drif file blijft op 0.0000 staan

Format: list

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

This is displayed as:

#6
/var/var
#9
named out of swap space
#37
Rewrite config_update.sh
#110
pen_wrapper enhancements

[[TicketQuery(id=123)]]

This is displayed as:

#123
trage redirect vanuit portal

Format: compact

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

This is displayed as:

#6, #9, #37, #110

Format: count

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

This is displayed as:

4

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 245)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#250 fixed test url voor /tools/check-inet-alive nobody huub
#249 fixed lvrouted crasht lodewijk huub
#245 fixed nsd schrijft /tmp vol nobody huub
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 245)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#250 fixed test url voor /tools/check-inet-alive nobody huub
Description

De test-url http://ams-ix.net die door check-inet-alive gebruikt wordt werkt niet op elke gateway (niet bij DeClercq, Juffermans, Robijn, Plantsoen - allemaal 9.0 config, maar ook niet bij Dwars - oude 11.1 config). Bijv. Juffermans# fetch -o /dev/null http://ams-ix.net 88438:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s23_clnt.c:602: fetch: http://ams-ix.net: Authentication error

Werkt WEL op Stadhuis en Sunnysidekick (allebei recente 11.2-RELEASE versies). Lijkt er dus op dat probleem wordt opgelost door installeren van de nieuwe 11.2 configuratie.

#249 fixed lvrouted crasht lodewijk huub
Description

Op stadhuis crasht lvrouted (on-)regelmatig (signal 11), ook met kleinere nsd. Geen probleem op nodes die geen gateway zijn. Ook niet geconstateerd bij de enige andere gateway OnsBuiten3.

Dec 27 20:26:09 Stadhuis kernel: pid 891 (lvrouted), uid 0: exited on signal 11 Dec 27 20:29:50 Stadhuis kernel: pid 1739 (lvrouted), uid 0: exited on signal 11 Dec 27 20:45:09 Stadhuis kernel: pid 2143 (lvrouted), uid 0: exited on signal 11 Dec 27 21:19:51 Stadhuis kernel: pid 2773 (lvrouted), uid 0: exited on signal 11 Dec 27 21:23:26 Stadhuis kernel: pid 3260 (lvrouted), uid 0: exited on signal 11 Dec 27 21:38:02 Stadhuis kernel: pid 3612 (lvrouted), uid 0: exited on signal 11 Dec 27 21:41:50 Stadhuis kernel: pid 4127 (lvrouted), uid 0: exited on signal 11 Dec 27 22:05:37 Stadhuis kernel: pid 4568 (lvrouted), uid 0: exited on signal 11 Dec 28 00:04:56 Stadhuis kernel: pid 5204 (lvrouted), uid 0: exited on signal 11 Dec 28 00:07:07 Stadhuis kernel: pid 6922 (lvrouted), uid 0: exited on signal 11 Dec 28 01:06:42 Stadhuis kernel: pid 7286 (lvrouted), uid 0: exited on signal 11 Dec 28 01:27:00 Stadhuis kernel: pid 8279 (lvrouted), uid 0: exited on signal 11 Dec 28 01:47:17 Stadhuis kernel: pid 8909 (lvrouted), uid 0: exited on signal 11 Dec 28 02:08:37 Stadhuis kernel: pid 9483 (lvrouted), uid 0: exited on signal 11 Dec 28 03:49:39 Stadhuis kernel: pid 10001 (lvrouted), uid 0: exited on signal 11 Dec 28 05:09:00 Stadhuis kernel: pid 11808 (lvrouted), uid 0: exited on signal 11 Dec 28 05:29:03 Stadhuis kernel: pid 12992 (lvrouted), uid 0: exited on signal 11 Dec 28 05:36:07 Stadhuis kernel: pid 13641 (lvrouted), uid 0: exited on signal 11 Dec 28 06:09:03 Stadhuis kernel: pid 14048 (lvrouted), uid 0: exited on signal 11 Dec 28 06:50:02 Stadhuis kernel: pid 14740 (lvrouted), uid 0: exited on signal 11 Dec 28 07:35:35 Stadhuis kernel: pid 15567 (lvrouted), uid 0: exited on signal 11 Dec 28 11:25:27 Stadhuis kernel: pid 16435 (lvrouted), uid 0: exited on signal 11

Stadhuis# lvrouted -v Version info: svn rev: 13830 branch: trunk trunk compile host: FreeBSD wlpkgbuild-default-node-job-01 11.2-RELEASE-p4 FreeBSD 11.2-RELEASE-p4 i386 compile date: Fri Dec 21 13:40:46 UTC 2018 compiled by: nobody ocamlopt: The OCaml native-code compiler, version 4.02.3

#245 fixed nsd schrijft /tmp vol nobody huub
Description

/tmp raakt vol door groot aantal nsd-xfr files bij test-nodes (SOM2, CeTIM2, etc).

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.