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: 2566 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 2638 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 96 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 56 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 747 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 1205 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 4651 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 1075 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 11838 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 2800 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 23995 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 4096 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 150 [[TicketQuery(created=thismonth..,count)]]
Number of closed Firefox tickets: 1 [[TicketQuery(status=closed,keywords~=firefox,count)]]
Number of closed Opera tickets: 11 [[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: 12 [[TicketQuery(status=closed,keywords~=firefox|opera,count)]]
Number of tickets that affect Firefox or are closed and affect Opera: 12 [[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: #25144, #25145, #25133 [[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 imi imi
Summary Import of background images from an image server

Format: list

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

This is displayed as:

No results

[[TicketQuery(id=123)]]

This is displayed as:

#123
Plugin actions cannot be registered and put in the toolbar

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

1 2 3 4 5 6 7 8 9 10 11 →
Ticket Resolution Summary Owner Reporter
#25143 fixed Icons of images are not updated team GerdP
#25142 fixed The SVG ”extnode.svg“ of plugin ”UtilsPlugin2“ contains an image that causes a console error team goodidea
#25141 fixed [PATCH] Debug logs & status report contain credentials team wangi
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 21102)

1 2 3 4 5 6 7 8 9 10 11 →
Ticket Resolution Summary Owner Reporter
#25143 fixed Icons of images are not updated team GerdP
Description

What steps will reproduce the problem?

  1. Have a layer with Geotagged Images with several pictures at different locations
  2. Open one of the images
  3. Switch between different images

What is the expected result?

The icon for the selected image is rendered in red, others in white/gray

What happens instead?

The rendering of the iconds is not (always) updated, sometimes there is a small delay, sometimes no change after several seconds. New rendering seems to depend on the viewport change. Also closing the image viewer dialog triggers the (correct) rendering.

Please provide any additional information below. Attach a screenshot if possible.

Revision:19713
Is-Local-Build:true
Build-Date:2026-11-28 09:00:48

Identification: JOSM/1.5 (19713 SVN en) Windows 11 64-Bit
OS Build number: Windows 10 Pro 26H2 (26300)
Memory Usage: 1712 MB / 11808 MB (197 MB allocated, but free)
Java version: 25.0.5.1+2-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080x32bpp@60Hz (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
Locale info: en_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.19700, -XX:MaxRAMPercentage=75.0, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM (Debug).exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (36493)
+ apache-commons (36483)
+ buildings_tools (36503)
+ comfort0 (36483)
+ ejml (36483)
+ geotools (36483)
+ jackson (36502)
+ jaxb (36483)
+ jts (36483)
+ o5m (36493)
+ opendata (36503)
+ pbf (36493)
+ photo_geotagging (36503)
+ poly (36483)
+ reverter (36503)
+ terracer (36503)
+ undelete (36503)
+ utilsplugin2 (36503)

Tagging presets:
+ c:\josm\core\resources\data\defaultpresets.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1

Map paint styles:
- c:\josm\core\resources\styles\standard\elemstyles.mapcss

Validator rules:
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1
+ c:\josm\core\resources\data\validator\combinations.mapcss
+ c:\josm\core\resources\data\validator\geometry.mapcss

Last errors/warnings:
- 00064.573 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=938646.7073420,6963107.5286664,939258.2035683,6963719.0248927
- 00065.731 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/alkis_wms?FORMAT=image/png&TRANSPARENT=FALSE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ALKIS&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=938646.7073420,6963107.5286664,939258.2035683,6963719.0248927
- 00067.253 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=938646.7073420,6962496.0324401,939258.2035683,6963107.5286664
- 00067.846 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=938035.2111157,6962496.0324401,938646.7073420,6963107.5286664
- 00101.101 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=937729.4630026,6963260.4027230,937805.9000308,6963336.8397513
- 00101.433 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/alkis_wms?FORMAT=image/png&TRANSPARENT=FALSE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ALKIS&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=937805.9000308,6963260.4027230,937882.3370591,6963336.8397513
- 00103.099 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=937805.9000308,6963260.4027230,937882.3370591,6963336.8397513
- 00106.716 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/alkis_wms?FORMAT=image/png&TRANSPARENT=FALSE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ALKIS&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=937805.9000308,6963336.8397513,937882.3370591,6963413.2767796
- 00107.314 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/alkis_wms?FORMAT=image/png&TRANSPARENT=FALSE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ALKIS&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=937729.4630026,6963260.4027230,937805.9000308,6963336.8397513
- 00112.878 W: JCS - Silent failure during download: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=937805.9000308,6963336.8397513,937882.3370591,6963413.2767796
#25142 fixed The SVG ”extnode.svg“ of plugin ”UtilsPlugin2“ contains an image that causes a console error team goodidea
Description

For some time now, I have been receiving this error message in the Java console when starting JOSM:

INFO: Failed to resolve URI: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A /wD/oL2nkwAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9sHDQoiCFCZCUUAAAE/SURBVEjH 1ZSxLgVBFIa/2dzIqLiuQiJZ1xto7q03q+ENPAYVnXgMT6BUUqG+CokXWJFIFFyiIYJRmN2MvTPM zqzCn0wzc+Y/f85/zoE/hohmUCjEF8/dqKvMp/nhg0hakChQVMS9wZjeYFw9J9HqS3IjiYlOFDl0 ELzrMk0z4vn+fG7SgyJPv2VfPrkWvnVHcYlgCLzqirxNxBd5qkrUkzmUm5DAois8Ce0YAy/AjetL 5cHV6pJ5fwFsAWc/pJvS5fgIsXAFONUns5RHAl2fOfotIAN2tU9ZrRFmgKe2Jj5r1AgBJtu86Pt8 9B00aWmEI+AY2AMeY8ojgUNgzXK/CRTATimiqckSOAD2tVobZoFtYKPI036TjeBS7sKCrRGSCOV1 3PqaHEKOYyM4t+l6CLkToUPU5qAFw7VN/w8+AUNbhNjHLU5MAAAAAElFTkSuQmCC

I have discovered that the cause appears to lie in the file “extnode.svg” of plugin ”UtilsPlugin2“ which contains an image. See screenshot ...

I suspect that this SVG file should be corrected (by resaving it without the embedded image).

#25141 fixed [PATCH] Debug logs & status report contain credentials team wangi
Description

The debug logs and status report contain credentials: Authorization header, cookies, OAuth client secret, API keys. With --debug, HttpClient logs the request and response headers as they are:

FINE: REQUEST HEADERS: {Accept=application/xml, */*;q=0.8, Accept-Encoding=gzip, deflate, Authorization=Bearer <the OAuth 2.0 access token>}

So the log holds the credentials of every authenticated request: the OAuth 2.0 bearer token, or with basic authentication the base64 of user name and password, which is the password in all but name. Proxy-Authorization is logged the same way, and the response headers show session cookies in Set-Cookie. With --trace, the body of a request is logged as it is too; for an OAuth 2.0 token request that is the client secret, the authorization code and its verifier, or a refresh token.

Debug and trace logs are what users can be asked for when something goes wrong, and they end up in public tickets: searching Trac for "REQUEST HEADERS" finds over a dozen tickets with such logs, not counting attached log files, which Trac search does not cover. Some of the logs posted had the token removed by hand, but not all. We shouldn't allow such leaks to be easy.

The status report shows every preference value as it is but for user names, passwords and access tokens, which are left out; so an API key written into the URL of a custom imagery entry, for example, is posted with every bug report.

Remote Control logs every request it receives at info level, so the redirect of an OAuth 2.0 authorization, with its authorization code, is in every log, not only debug ones. The code is short-lived and useless without the PKCE verifier, but it does not belong there either.

#21756 stripped credentials from the URLs in the log (r18407), and r18652 moved that into TextUtils.stripUrl(); the headers and the body were not covered. The attached patch keeps all of it in TextUtils:

  • stripUrl() also strips secret, password, verifier and code (the latter as a whole parameter name only, so that e.g. a postcode is kept), in addition to token, key and connectId, and a value now ends at white space too, so that the rest of a log line is kept;
  • a form-encoded request body has the syntax of a query, so HttpClient logs it at trace level through stripUrl(): that covers client_secret, code, code_verifier, refresh_token and password of OAuth 2.0 token requests; other bodies are logged as before;
  • new stripHeaders() replaces the values of Authorization and Proxy-Authorization with ...stripped..., but keeps the scheme, so that the log still says what kind of authentication was used (Authorization=Bearer ...stripped...), and replaces the values of Cookie and Set-Cookie entirely; HttpClient logs request and response headers through it;
  • the URL of a request with a body is logged through stripUrl(), as the other requests already were, and so is the request line received by Remote Control;
  • the status report passes each string of a preference value through stripUrl(), inside lists and maps too.

New TextUtilsTest covers both functions. HttpClientCredentialsLoggingTest makes requests to a local WireMock server at trace level with a bearer token, a session cookie and a token request, and checks that none of them appear in the log while the scheme does; a new case in RemoteControlTest sends an authorization redirect and checks that the code is not logged; new ShowStatusReportActionTest checks the preference values, among them a custom imagery entry. Each fails if the corresponding logging call goes back to logging the values. Checkstyle and PMD are clean for the change.

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


See also: TracQuery, TracTickets, TracReports

Last modified 3 years ago Last modified on 2023-12-28T13:06:05+01:00
Note: See TracWiki for help on using the wiki.