Trac Ticket Queries
Table of Contents
In addition to reports, Trac provides support for custom ticket queries, which can be used to display tickets that meet specified criteria.
To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.
Filters
When you first go to the query page, the default filter will display tickets relevant to you:
- If logged in then all open tickets, it will display open tickets assigned to you.
- If not logged in but you have specified a name or email address in the preferences, then it will display all open tickets where your email (or name if email not defined) is in the CC list.
- If not logged in and no name/email is defined in the preferences, then all open issues are displayed.
Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the dropdown lists at the bottom corners of the filters box; 'And' conditions on the left, 'Or' conditions on the right. Filters with either a text box or a dropdown menu of options can be added multiple times to perform an Or on the criteria.
For text fields such as Keywords and CC the -
operator can be used to negate a match and double quotes (since 1.2.1) can be used to match a phrase. For example, a contains match for word1 word2 -word3 "word4 word5"
matches tickets containing word1
and word2
, not word3
and word4 word5
.
You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.
After you have edited your filters, click the Update button to refresh your results.
Keyboard shortcuts are available for manipulating the checkbox filters:
- Clicking on a filter row label toggles all checkboxes.
- Pressing the modifier key while clicking on a filter row label inverts the state of all checkboxes.
- Pressing the modifier key while clicking on a checkbox selects the checkbox and deselects all other checkboxes in the filter. Since 1.2.1 this also works for the Columns checkboxes.
The modifier key is platform and browser dependent. On Mac the modified key is Option/Alt or Command. On Linux the modifier key is Ctrl + Alt. Opera on Windows seems to use Ctrl + Alt, while Alt is effective for other Windows browsers.
Navigating Tickets
Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.
You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria , the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.
The query results can be refreshed and cleared of these status indicators by clicking the Update button again.
Saving Queries
Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.
Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.
Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.
Using TracLinks
You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.
[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]
Which is displayed as:
This uses a very simple query language to specify the criteria, see Query Language.
Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ?
character:
[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]
Which is displayed as:
Customizing the table format
You can also customize the columns displayed in the table format (format=table) by using col=<field>. You can specify multiple fields and what 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 1186)
Full rows
In table format you can also have full rows by 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 1186)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#1608 | duplicate | western_digital-WD161KRYZ-01AGBB0 drive to add to database | ||
Description |
Please add Western Digital WD161KRYZ-01AGBB0 HDD to the database. Product description (PDF file): https://documents.westerndigital.com/content/dam/doc-library/en_us/assets/public/western-digital/product/internal-drives/wd-gold/product-brief-wd-gold-hdd.pdf |
|||
#1607 | wontfix | Bug with Seagate BarraCuda 3.5 (SMR) ST8000DM004-2U9188 on amd64 | ||
Description |
Hello, I found bug with smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.17.0-1-amd64], it's wont detect Seagate BarraCuda? 3.5 (SMR) ST8000DM004-2U9188 on amd64 correctly and doesn't read any smart data, but it does on same smartctl version at armv6l-linux-5.17.0-1-rpi. There is output from smartctl on amd64: ~# smartctl -a /dev/sdb smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.17.0-1-amd64] (local build) Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org Read Device Identity failed: scsi error unsupported field in scsi command If this is a USB connected device, look at the various --device=TYPE variants A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options. If I'm adding --device=sat,auto: ~# smartctl -a /dev/sdb --device=sat,auto smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.17.0-1-amd64] (local build) Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Vendor: Seagate Product: Desktop Revision: 040B Compliance: SPC-4 User Capacity: 8,001,563,221,504 bytes [8.00 TB] Logical block size: 512 bytes Physical block size: 4096 bytes Logical Unit id: 0x5000000000000001 Serial number: NA7HT28P Device type: disk Local Time is: Mon May 2 15:59:53 2022 BST SMART support is: Available - device has SMART capability. SMART support is: Disabled Temperature Warning: Disabled or Not Supported === 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 And correct behavior on arm by running smartctl -a /dev/sdb --json: { "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 3 ], "svn_revision": "5338", "platform_info": "armv6l-linux-5.17.0-1-rpi", "build_info": "(local build)", "argv": [ "smartctl", "--all", "/dev/sda", "--json" ], "drive_database_version": { "string": "7.3/5319" }, "exit_status": 0 }, "local_time": { "time_t": 1651346131, "asctime": "Sat Apr 30 19:15:31 2022 UTC" }, "device": { "name": "/dev/sda", "info_name": "/dev/sda [SAT]", "type": "sat", "protocol": "ATA" }, "model_family": "Seagate BarraCuda 3.5 (SMR)", "model_name": "ST8000DM004-2U9188", "serial_number": "WSC127TX", "wwn": { "naa": 5, "oui": 3152, "id": 3766737109 }, "firmware_version": "0001", "user_capacity": { "blocks": 15628053168, "bytes": 8001563222016 }, "logical_block_size": 512, "physical_block_size": 4096, "rotation_rate": 5400, "form_factor": { "ata_value": 2, "name": "3.5 inches" }, "trim": { "supported": false }, "in_smartctl_database": true, "ata_version": { "string": "ACS-3 T13/2161-D revision 5", "major_value": 2016, "minor_value": 109 }, "sata_version": { "string": "SATA 3.1", "value": 127 }, "interface_speed": { "max": { "sata_value": 14, "string": "6.0 Gb/s", "units_per_second": 60, "bits_per_unit": 100000000 }, "current": { "sata_value": 2, "string": "3.0 Gb/s", "units_per_second": 30, "bits_per_unit": 100000000 } }, "smart_support": { "available": true, "enabled": true }, "smart_status": { "passed": true }, "ata_smart_data": { "offline_data_collection": { "status": { "value": 0, "string": "was never started" }, "completion_seconds": 0 }, "self_test": { "status": { "value": 0, "string": "completed without error", "passed": true }, "polling_minutes": { "short": 1, "extended": 963, "conveyance": 2 } }, "capabilities": { "values": [ 115, 3 ], "exec_offline_immediate_supported": true, "offline_is_aborted_upon_new_cmd": false, "offline_surface_scan_supported": false, "self_tests_supported": true, "conveyance_self_test_supported": true, "selective_self_test_supported": true, "attribute_autosave_enabled": true, "error_logging_supported": true, "gp_logging_supported": true } }, "ata_sct_capabilities": { "value": 12453, "error_recovery_control_supported": false, "feature_control_supported": false, "data_table_supported": true }, "ata_smart_attributes": { "revision": 10, "table": [ { "id": 1, "name": "Raw_Read_Error_Rate", "value": 69, "worst": 65, "thresh": 6, "when_failed": "", "flags": { "value": 15, "string": "POSR-- ", "prefailure": true, "updated_online": true, "performance": true, "error_rate": true, "event_count": false, "auto_keep": false }, "raw": { "value": 7241282, "string": "7241282" } }, { "id": 3, "name": "Spin_Up_Time", "value": 92, "worst": 92, "thresh": 0, "when_failed": "", "flags": { "value": 3, "string": "PO---- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": false, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 4, "name": "Start_Stop_Count", "value": 100, "worst": 100, "thresh": 20, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 8, "string": "8" } }, { "id": 5, "name": "Reallocated_Sector_Ct", "value": 100, "worst": 100, "thresh": 10, "when_failed": "", "flags": { "value": 51, "string": "PO--CK ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 7, "name": "Seek_Error_Rate", "value": 100, "worst": 253, "thresh": 45, "when_failed": "", "flags": { "value": 15, "string": "POSR-- ", "prefailure": true, "updated_online": true, "performance": true, "error_rate": true, "event_count": false, "auto_keep": false }, "raw": { "value": 161127, "string": "161127" } }, { "id": 9, "name": "Power_On_Hours", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 2651360621232150, "string": "22h+10m+17.318s" } }, { "id": 10, "name": "Spin_Retry_Count", "value": 100, "worst": 100, "thresh": 97, "when_failed": "", "flags": { "value": 19, "string": "PO--C- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 12, "name": "Power_Cycle_Count", "value": 100, "worst": 100, "thresh": 20, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 7, "string": "7" } }, { "id": 183, "name": "Runtime_Bad_Block", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 184, "name": "End-to-End_Error", "value": 100, "worst": 100, "thresh": 99, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 187, "name": "Reported_Uncorrect", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 188, "name": "Command_Timeout", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0 0 0" } }, { "id": 189, "name": "High_Fly_Writes", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 58, "string": "-O-RCK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": true, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 190, "name": "Airflow_Temperature_Cel", "value": 54, "worst": 53, "thresh": 40, "when_failed": "", "flags": { "value": 34, "string": "-O---K ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": false, "auto_keep": true }, "raw": { "value": 790233134, "string": "46 (Min/Max 26/47)" } }, { "id": 191, "name": "G-Sense_Error_Rate", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 192, "name": "Power-Off_Retract_Count", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 4, "string": "4" } }, { "id": 193, "name": "Load_Cycle_Count", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 50, "string": "-O--CK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 24, "string": "24" } }, { "id": 194, "name": "Temperature_Celsius", "value": 46, "worst": 47, "thresh": 0, "when_failed": "", "flags": { "value": 34, "string": "-O---K ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": false, "auto_keep": true }, "raw": { "value": 90194313262, "string": "46 (0 21 0 0 0)" } }, { "id": 195, "name": "Hardware_ECC_Recovered", "value": 69, "worst": 65, "thresh": 0, "when_failed": "", "flags": { "value": 26, "string": "-O-RC- ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": true, "event_count": true, "auto_keep": false }, "raw": { "value": 7241282, "string": "7241282" } }, { "id": 197, "name": "Current_Pending_Sector", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 18, "string": "-O--C- ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 198, "name": "Offline_Uncorrectable", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 16, "string": "----C- ", "prefailure": false, "updated_online": false, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 199, "name": "UDMA_CRC_Error_Count", "value": 200, "worst": 200, "thresh": 0, "when_failed": "", "flags": { "value": 62, "string": "-OSRCK ", "prefailure": false, "updated_online": true, "performance": true, "error_rate": true, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 240, "name": "Head_Flying_Hours", "value": 100, "worst": 253, "thresh": 0, "when_failed": "", "flags": { "value": 0, "string": "------ ", "prefailure": false, "updated_online": false, "performance": false, "error_rate": false, "event_count": false, "auto_keep": false }, "raw": { "value": 4972120429821957, "string": "5h+19m+17.662s" } }, { "id": 241, "name": "Total_LBAs_Written", "value": 100, "worst": 253, "thresh": 0, "when_failed": "", "flags": { "value": 0, "string": "------ ", "prefailure": false, "updated_online": false, "performance": false, "error_rate": false, "event_count": false, "auto_keep": false }, "raw": { "value": 4919495, "string": "4919495" } }, { "id": 242, "name": "Total_LBAs_Read", "value": 100, "worst": 253, "thresh": 0, "when_failed": "", "flags": { "value": 0, "string": "------ ", "prefailure": false, "updated_online": false, "performance": false, "error_rate": false, "event_count": false, "auto_keep": false }, "raw": { "value": 2321787, "string": "2321787" } } ] }, "power_on_time": { "hours": 22, "minutes": 10 }, "power_cycle_count": 7, "temperature": { "current": 46 }, "ata_smart_error_log": { "summary": { "revision": 1, "count": 0 } }, "ata_smart_self_test_log": { "standard": { "revision": 1, "count": 0 } }, "ata_smart_selective_self_test_log": { "revision": 1, "table": [ { "lba_min": 0, "lba_max": 0, "status": { "value": 0, "string": "Not_testing" } }, { "lba_min": 0, "lba_max": 0, "status": { "value": 0, "string": "Not_testing" } }, { "lba_min": 0, "lba_max": 0, "status": { "value": 0, "string": "Not_testing" } }, { "lba_min": 0, "lba_max": 0, "status": { "value": 0, "string": "Not_testing" } }, { "lba_min": 0, "lba_max": 0, "status": { "value": 0, "string": "Not_testing" } } ], "flags": { "value": 0, "remainder_scan_enabled": false }, "power_up_scan_resume_minutes": 0 } } |
|||
#1602 | invalid | WDS200T1X0E-00AFY0 | ||
Description |
New NVMe drive for smartctl database. MAKE: Western Digital Model: SN850 (2TB), WDS200T1X0E-00AFY0 smartctl does not seem to correctly query the device attributes. # smartctl -t short /dev/nvme1 # smartctl -H -c -a -x /dev/nvme1 smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.25.1.el8_4.x86_64] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Number: WDS200T1X0E-00AFY0 Serial Number: 22011L800258 Firmware Version: 614900WD PCI Vendor/Subsystem ID: 0x15b7 IEEE OUI Identifier: 0x001b44 Total NVM Capacity: 2,000,398,934,016 [2.00 TB] Unallocated NVM Capacity: 0 Controller ID: 8224 Number of Namespaces: 1 Namespace 1 Size/Capacity: 2,000,398,934,016 [2.00 TB] Namespace 1 Formatted LBA Size: 512 Namespace 1 IEEE EUI-64: 001b44 8b45b16f75 Local Time is: Sun Apr 24 09:09:07 2022 MDT Firmware Updates (0x14): 2 Slots, no Reset required Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test Optional NVM Commands (0x00df): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp *Other* Maximum Data Transfer Size: 128 Pages Warning Comp. Temp. Threshold: 84 Celsius Critical Comp. Temp. Threshold: 88 Celsius Namespace 1 Features (0x02): NA_Fields Supported Power States St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat 0 + 9.00W 9.00W - 0 0 0 0 0 0 1 + 4.10W 4.10W - 0 0 0 0 0 0 2 + 3.50W 3.50W - 0 0 0 0 0 0 3 - 0.0250W - - 3 3 3 3 5000 10000 4 - 0.0050W - - 4 4 4 4 3900 45700 Supported LBA Sizes (NSID 0x1) Id Fmt Data Metadt Rel_Perf 0 + 512 0 2 1 - 4096 0 1 === START OF SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED SMART/Health Information (NVMe Log 0x02) Critical Warning: 0x00 Temperature: 32 Celsius Available Spare: 100% Available Spare Threshold: 10% Percentage Used: 0% Data Units Read: 375,243 [192 GB] Data Units Written: 525,347 [268 GB] Host Read Commands: 2,799,821 Host Write Commands: 2,496,835 Controller Busy Time: 4 Power Cycles: 20 Power On Hours: 211 Unsafe Shutdowns: 8 Media and Data Integrity Errors: 0 Error Information Log Entries: 0 Warning Comp. Temperature Time: 0 Critical Comp. Temperature Time: 0 Error Information (NVMe Log 0x01, max 256 entries) No Errors Logged |
Query Language
query:
TracLinks and the [[TicketQuery]]
macro both use a mini “query language” for specifying query filters. Filters are separated by ampersands (&
). Each filter consists of the ticket field name, an operator and one or more values. More than one value are separated by a pipe (|
), meaning that the filter matches any of the values. To include a literal &
or |
in a value, escape the character with a backslash (\
).
The available operators are:
= | the field content exactly matches one of the values |
~= | the field content contains one or more of the values |
^= | the field content starts with one of the values |
$= | the field content ends with one of the values |
All of these operators can also be negated:
!= | the field content matches none of the values |
!~= | the field content does not contain any of the values |
!^= | the field content does not start with any of the values |
!$= | the field content does not end with any of the values |
Filters combining matches and negated matches can be constructed for text fields such as Keywords and CC when using the contains (~=
) operator. The -
operator is used to negate a match and double quotes (since 1.2.1) are used for whitespace-separated words in a phrase. For example, keywords~=word1 word2 -word3 "word4 word5"
matches tickets containing word1
and word2
, not word3
and also word4 word5
.
status=closed,keywords~=firefox | query closed tickets that contain keyword firefox
|
status=closed,keywords~=opera | query closed tickets that contain keyword opera
|
status=closed,keywords~=firefox opera | query closed tickets that contain keywords firefox and opera
|
status=closed,keywords~=firefox|opera | query closed tickets that contain keywords firefox or opera
|
status=closed,keywords~=firefox,or,keywords~=opera | query closed tickets that contain keyword firefox , or (closed or unclosed) tickets that contain keyword opera
|
status=closed,keywords~=firefox -opera | query closed tickets that contain keyword firefox , but not opera
|
status=closed,keywords~=opera -firefox | query closed tickets that contain keyword opera , but no firefox
|
The date fields created
and modified
can be constrained by using the =
operator and specifying a value containing two dates separated by two dots (..
). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be omitted to avoid having to quote the query string.
created=2007-01-01..2008-01-01 | query tickets created in 2007 |
created=lastmonth..thismonth | query tickets created during the previous month |
modified=1weekago.. | query tickets that have been modified in the last week |
modified=..30daysago | query tickets that have been inactive for the last 30 days |
Note that modified
is the last modified time, so modified
with a date range shows ticket that were last modified in that date range. If a ticket was modified in the date range, but modified again after the end date, it will not be included in the results.
See also: TracTickets, TracReports, TracGuide, TicketQuery