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: 29 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 29 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 1 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 7 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 8 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 2 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 11 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 7 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 102 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 33 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 167 [[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: 2 [[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: #157, #159, #167 [[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 David A. Riggs
Summary Update Trac Settings

Format: list

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

This is displayed as:

No results

[[TicketQuery(id=123)]]

This is displayed as:

#123
brew upgrade / reinstall survex fail

Format: compact

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

This is displayed as:

No results

Format: count

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

This is displayed as:

0

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 in 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 130)

1 2 3 4 5 6 7 8 9 10 11 →
Ticket Resolution Summary Owner Reporter
#167 fixed Survex drops Walls stations; possibly related to multiple levels of nested 'exported' shots Olly Betts Joe Walko
#166 fixed Walls: Overly aggressive warnings when using partial name for units of measurement in #UNITS A|V|D|S etc Olly Betts Joe Walko
#164 fixed Bugs in UV=/UVH=/UVV= handling Olly Betts Joe Walko
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 130)

1 2 3 4 5 6 7 8 9 10 11 →
Ticket Resolution Summary Owner Reporter
#167 fixed Survex drops Walls stations; possibly related to multiple levels of nested 'exported' shots Olly Betts Joe Walko
Description

See attached sample files - Running emily.wpj in both Walls and cavern will illustrate the issue.

This group of stations, all in the same part of the Walls tree, are the only stations being dropped in the large dataset. I've gone round and round on this, and can't quite pin it down, nor can I reproduce with simplified SRV examples.

Attached are four "as is" files from the dataset, along with a wpj and a 'fixed-point' SRV which reproduces the problem. Was not able to simplify it much beyond this level.

Note the very extensive "indirect" references to 'external' stations, some of which no longer reside in an SRV with a matching #PREFIX. This due to extensive resurvey and station-replacements, but they retained original station nomenclature when the old stations could be recovered.

This feels like an issue related to too much levels 'exported' nodes, but root causes eludes me.

I tested with Survex updates pulled earlier today, probably before c36617f08037a1c697fd40f4e98866f617e4a3e1 (related to REF and geo-location).

These log-file warnings seem relevant, but I can't discern why they happen: The following survey stations are not attached to a fixed point:
FSB3693.SRV:26: info: 2473:C132
FSB3689.SRV:47: info: 3626:H6
FSB3689.SRV:42: info: 3689:GB6
FSB3689.SRV:14: info: 3626:H2'

List of Walls stations missing from Survex:

3626:H6
3632:Z21
3689:A14
3689:H10
3689:H11
3689:H12
3689:H13
3689:H14
3689:H7
3689:H8
3689:H9
3690:H15
3690:H16
3690:H17
3690:H18
3690:H19
3690:H20
3690:H21
3690:H21A
3690:H21B
3690:R1
3690:R2
3690:R2A
3690:R2B
3690:R2C
3690:R2D
3690:R3
#166 fixed Walls: Overly aggressive warnings when using partial name for units of measurement in #UNITS A|V|D|S etc Olly Betts Joe Walko
Description

Cavern should not warn on undocumented usage of shorthand units of measure in #UNITS. #UNITS A=DEG is commonly used; the latest build now warns on this.

Walls only cares about the first character when specifying units of measurements with #UNITS A|V|D|AB|VB|S, etc.

For example, with #UNITS A=DEGREE, Walls only cares about the "D". Thus, for better or for worse, these are all valid in Walls as argument to #UNITS A: A=Degree, A=deg, A=De, A=Dxyzzy, A=DegreesWhatever

A reasonable compromise would be to warn when, the argument is not legitimate shorthand. For example, "DEG", "DE", DEGR" would be OK, but "Dxyzzy" would not (even though Walls accepts Dxyzzy as shorthand for degrees).

Note Walls does not extend this same flexibility when specifying units as a suffix - single character is enforced in those cases.

#164 fixed Bugs in UV=/UVH=/UVV= handling Olly Betts Joe Walko
Description

###Notes on milestone v1.4.23, commit d895951a

###Previously I did not have handy Linux build environment to build from source; that's been rectified.

###Notes below reflect testing on Ubuntu 24.04 enviroment, survex milestone v1.4.23, commit d895951a. Prior feedback was from Windows 10, Survex release 1.4.22.


###Something new. UV or variance related, I presume:

Fatal error:

Simplifying network... not sym - 1,0 = 22531.619363, 0,1 was 22531.619363 netbits.c:703: smulvs didn't produce a sym mx cavern: error: Bug in program detected! Please report this to the authors

### I narrowed this one to just one of the four datasets which get merged, and unsurprisingly, it's the dataset which has prolific usage of UV/UVH/UVV and variance overrides

### I went through and tried to comment out instances where UV/UVH/UVV is set to a very-high-number, or is set to "0", but I'm sure I missed some. Error changed a bit after commenting those out:

Calculating traverses... netskel.c:666: assert(!fEquate) failed cavern: error: Bug in program detected! Please report this to the authors

### At this point I didn't pursue any further, but I assume the error is UVx or variance related.


###Massive decrease in quantity of frontsight/backsight disagree warnings; this effectively resolves the issue with warning logfile clutter.


###Explicit empty prefixes seem to be bahaving better, albeit with a 'space', which seems OK for now ; see additional comments in ticket #163.


### IH/TH data gets discarded for underwater surveys if TAPE=SS and ORDER=DAV. But this combination is valid, since such surveys typically start or end above water, and often have some DAV shots, with inclination instead of IT/HT

CFSB1382.SRV:17:16: warning: Instrument and target heights currently ignored with Walls option combination “TAPE=SS” and “ORDER=DAV”

S1 S2 70 84 -- 0 15 *8 8 0 5*

~

CFSB1382.SRV:18:16: warning: Instrument and target heights currently ignored with Walls option combination “TAPE=SS” and “ORDER=DAV”

S2 S3 60 89 -- 15 31

CFSB1382.SRV:19:16: warning: Instrument and target heights currently ignored with Walls option combination “TAPE=SS” and “ORDER=DAV”

S3 S4 15 84 -- 31 34

CFSB1382.SRV:20:16: warning: Instrument and target heights currently ignored with Walls option combination “TAPE=SS” and “ORDER=DAV”

S4 S5 22 82 -- 34 33


###Comma in variance override probably shoudn't trigger a warning, since (UVH, UVV) form isn't all that unexpected.

CFSB1253.SRV:46:50: warning: Interpreting “,” as separating readings but may be intended as a decimal point

C1252:T20 F28 9.3 246 -28.75 -- -- *0 10 1 .5* (3,3)

1 2 3 4 5 6 7 8 9 10 11 →


See also: TracQuery, TracTickets, TracReports

Last modified 4 months ago Last modified on Jun 11, 2026, 12:38:13 AM
Note: See TracWiki for help on using the wiki.