wiki:TicketQuery

Version 2 (modified by trac, 13 months 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: 1 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 259 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 4 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 2 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 154 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 90 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 174 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 106 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 909 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 1 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 1705 [[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: 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: #1925, #1904, #1913 [[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 1433)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1925 fixed Add TERRAMASTER D4-320 USB3.2 Gen 2 enclosure to database (0x5432:0x235c) Christian Franke superice
#1924 fixed OCZ-VERTEX3.20 Christian Franke joaolopesgomes
#1921 fixed Read Self-test Log failed: Invalid Field in Command (0x002) Louis Bertrand
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 1433)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1925 fixed Add TERRAMASTER D4-320 USB3.2 Gen 2 enclosure to database (0x5432:0x235c) Christian Franke superice
Description

I have a TerraMaster D4-320 that is not being picked up by smartctl even though the device should be in the database (see #1856). It seems that there may be some models (like mine) with a different ID. Output from smartctl:

smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.6.44-production+truenas] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdb: Unknown USB bridge [0x5432:0x235c (0x100)]
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

Running smartctl with the -d sat works correctly and shows all correct smart data.

#1924 fixed OCZ-VERTEX3.20 Christian Franke joaolopesgomes
Description

OCZ-VERTEX3.20 (newer model 20nm) SandForce based is a very old drive which was recently unboxed, i've noticed that the smartctl drivedb does not include it, only OCZ-VERTEX3 (older model 25nm) info is listed:

START OF INFORMATION SECTION

Model Family: SandForce Driven SSDs Device Model: OCZ-VERTEX3

But not OCZ-VERTEX3.20:

START OF INFORMATION SECTION

Device Model: OCZ-VERTEX3.20

For more information on this specific drive:

https://www.guru3d.com/review/ocz-vertex-3-20-ssd-benchmark-review-test/ https://www.thessdreview.com/our-reviews/ocz-vertex-3-20-20nm-ssd-review-240gb/2/

#1921 fixed Read Self-test Log failed: Invalid Field in Command (0x002) Louis Bertrand
Description

When executing sudo smartctl -a /dev/nvme0n1, I see the following error at the bottom of the output: Read Self-test Log failed: Invalid Field in Command (0x002). I get the same message if I try to run a test with $ sudo smartctl -t long /dev/nvme0n1

I'm not sure if it's a limitation of smartmontools or the drive.

Details below.

Thanks

Linux Mint 22 Lenovo A485 AMD Ryzen 7 Pro

SMART capabilities

$ sudo smartctl -c /dev/nvme0n1
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.8.0-51-generic] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Firmware Updates (0x16):            3 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x0057):     Comp Wr_Unc DS_Mngmt Sav/Sel_Feat Timestmp
Log Page Attributes (0x0f):         S/H_per_NS Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg
Maximum Data Transfer Size:         128 Pages
Warning  Comp. Temp. Threshold:     82 Celsius
Critical Comp. Temp. Threshold:     85 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     8.49W       -        -    0  0  0  0        0       0
 1 +     4.48W       -        -    1  1  1  1        0     200
 2 +     3.18W       -        -    2  2  2  2        0    1000
 3 -   0.0400W       -        -    3  3  3  3     2000    1200
 4 -   0.0050W       -        -    4  4  4  4      500    9500

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

System inventory

Drives:
  Local Storage: total: 931.51 GiB used: 345.38 GiB (37.1%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 1TB size: 931.51 GiB
    speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter> fw-rev: 5B2QGXA7
    temp: 33.9 C scheme: GPT
Partition:
  ID-1: / size: 915.32 GiB used: 345.37 GiB (37.7%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 511 MiB used: 8.4 MiB (1.6%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 512 KiB (0.0%) priority: -2
    file: /swapfile

Block devices

$ blkid
/dev/nvme0n1p1: UUID="4E14-9ED5" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="3a87b0a1-c8f5-4f80-8293-2d0f44ef0686"
/dev/nvme0n1p2: UUID="3563abf5-67ad-4356-8a82-d71256c44f5b" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="4772ad49-3f03-489f-af48-9d05afe6d488"

Firmware

$ sudo fwupdmgr get-devices

─SSD 980 PRO 1TB:
│     Device ID:          3743975ad7f64f8d6575a9ae49fb3a8856fe186f
│     Summary:            NVM Express solid state drive
│     Current version:    5B2QGXA7
│     Vendor:             Samsung (NVME:0x144D)
│     Serial Number:      S5P2NL0W414594Y
│     Problems:           • Device requires AC power to be connected
│     GUIDs:              bec63ed7-a95f-54fe-b8cc-8e9fee64ba5a ← NVME\VEN_144D&DEV_A80A
│                         310f81b5-6fce-501e-acfb-487d10501e78 ← NVME\VEN_144D&DEV_A80A&SUBSYS_144DA801
│                         1dc6777c-1ed3-521f-8267-b61f0c6b3902 ← Samsung SSD 980 PRO 1TB
│     Device Flags:       • Internal device
│                         • System requires external power source
│                         • Needs a reboot after installation
│                         • Device is usable for the duration of the update
│                         • Updatable
│                         • Signed Payload
│   

Let me know if you need anything else.

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.