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: 2 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 254 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 4 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 1 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 158 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 92 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 178 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 109 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 916 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 2 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 1719 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 1 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 6 [[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: #1943, #1942, #1941 [[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 jhering Christian Franke
Summary smartmontools build fails on QNX

Format: list

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

This is displayed as:

No results

[[TicketQuery(id=123)]]

This is displayed as:

#123
Option DEVISCAN does not work on OpenBSD >= 4.8

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

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1943 invalid Add Sandisk Cruzer to database Phillip Link
#1939 invalid Warning! SMART Attribute Thresholds Structure error: invalid SMART checksum Tony__T
#1935 duplicate Problems with S.M.A.R.T (OMV - Short self-test on /dev/nvme0n1) NicolaiW
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 1453)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1943 invalid Add Sandisk Cruzer to database Phillip Link
Description
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.12.12+bpo-amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               SanDisk
Product:              Cruzer Blade
Revision:             1.00
Compliance:           SPC-4
User Capacity:        31 406 948 352 bytes [31,4 GB]
Logical block size:   512 bytes
Serial number:        4C530000230711118562
Device type:          disk
Local Time is:        Sun Mar 23 22:05:43 2025 CET
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported
Read Cache is:        Enabled
Writeback Cache is:   Disabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging
Device does not support Background scan results logging
#1939 invalid Warning! SMART Attribute Thresholds Structure error: invalid SMART checksum Tony__T
Description

Warning! SMART Attribute Thresholds Structure error: invalid SMART checksum

I purchased a new WD Red Plus from Amazon and received this warning. Returned and bought another direct from Western Digital and received the same warning on the 2nd drive. The WD Red Plus that I have from a year ago does not receive this warning, so I suspect that WD made a change to the firmware

Attached are output from 'smartctl -x -a /dev/sdX' and 'smartctl -r ataioctl,2 -A /dev/sdX'

I realize that this is just a warning and as a long test completes without error I can just ignore it, but still thought this was worth a ticket

#1935 duplicate Problems with S.M.A.R.T (OMV - Short self-test on /dev/nvme0n1) NicolaiW
Description

Hello everyone, for some time now, Open Media Vault has been sending me the following error message:

This message was generated by the smartd daemon running on:

host name: omv-nas
DNS domain: local

The following warning/error was logged by the smartd daemon:

Device: /dev/disk/by-id/nvme-CT4000P3SSD8_2342E88107D9, number of Error Log entries increased from 9 to 10

Device info:
CT4000P3SSD8, S/N:2342E88107D9, FW:P9CR30A, NSID:1

For details see host's SYSLOG.

You can also use the smartctl utility for further investigation.
The original message about this issue was sent at Mon Feb 10 14:32:12 2025 CET
Another message will be sent in 24 hours if the problem persists.

When I try to run a "Short self-test" on the "/dev/nvme0n1" manually, omv outputs the following:

smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.12.9+bpo-amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, http://www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number: CT4000P3SSD8
Serial Number: 2342E88107D9
Firmware Version: P9CR30A
PCI Vendor/Subsystem ID: 0xc0a9
IEEE OUI Identifier: 0x00a075
Controller ID: 1
NVMe Version: 1.4
Number of Namespaces: 1
Namespace 1 Size/Capacity: 4,000,787,030,016 [4.00 TB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 6479a7 8440000039
Local Time is: Tue Feb 18 15:25:34 2025 CET
Firmware Updates (0x12): 1 Slot, no Reset required
Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005e): Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x06): Cmd_Eff_Lg Ext_Get_Lg
Maximum Data Transfer Size: 64 Pages
Warning Comp. Temp. Threshold: 85 Celsius
Critical Comp. Temp. Threshold: 95 Celsius

Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 6.00W 0.0000W - 0 0 0 0 0 0
1 + 3.00W 0.0000W - 0 0 0 0 0 0
2 + 1.50W 0.0000W - 0 0 0 0 0 0
3 - 0.0250W 0.0000W - 3 3 3 3 5000 1900
4 - 0.0030W - - 4 4 4 4 13000 100000

Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 1
1 - 4096 0 0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 41 Celsius
Available Spare: 100%
Available Spare Threshold: 5%
Percentage Used: 0%
Data Units Read: 209,028 [107 GB]
Data Units Written: 340,472 [174 GB]
Host Read Commands: 535,891
Host Write Commands: 705,317
Controller Busy Time: 10
Power Cycles: 7
Power On Hours: 190
Unsafe Shutdowns: 0
Media and Data Integrity Errors: 0
Error Information Log Entries: 10
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 1: 41 Celsius
Temperature Sensor 2: 57 Celsius
Temperature Sensor 8: 41 Celsius

Error Information (NVMe Log 0x01, 16 of 16 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS
0 10 0 0x4010 0x4005 0x028 0 0 -

Everything works perfectly with the SSD hard drive.

I'm still a bit of a newbie on this topic and would really appreciate some help with this problem.

1 2 3 4 5 6 7 8 9 10 11


See also: TracQuery, TracTickets, TracReports

Last modified 15 months ago Last modified on Jan 3, 2024, 10:40:13 AM
Note: See TracWiki for help on using the wiki.