Version 3 (modified by 6 years ago) (diff) | ,
---|
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 1291)
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 1291)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#1745 | fixed | Don't print error log entries if error count is zero | ||
Description |
I received a new 256Gb Kingston (M-SATA) SSD and as usual I filled it with zeroes and then ran a long self-test before taking it into use.
Here's the output of smartctl 7.4 2023-08-01 r5530 [x86_64-linux-4.14.23-ck1-mainline-core2-rjvb] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Silicon Motion based SSDs Device Model: KINGSTON SKC600MS256G Serial Number: 50026B77856B72A3 LU WWN Device Id: 5 0026b7 7856b72a3 Firmware Version: S4800105 User Capacity: 256,060,514,304 bytes [256 GB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: Solid State Device Form Factor: 2.5 inches TRIM Command: Available, deterministic, zeroed Device is: In smartctl database 7.3/5533 ATA Version is: ACS-3 T13/2161-D revision 5 SATA Version is: SATA 3.3, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Sat Sep 9 18:35:36 2023 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x82) Offline data collection activity was completed without error. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 0) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0002) Does not save SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 30) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x0031) SCT Status supported. SCT Feature Control supported. SCT Data Table supported. SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0000 100 100 000 Old_age Offline - 0 5 Reallocated_Sector_Ct 0x0000 100 100 000 Old_age Offline - 0 9 Power_On_Hours 0x0000 100 100 000 Old_age Offline - 4 12 Power_Cycle_Count 0x0000 100 100 000 Old_age Offline - 2 148 Total_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 19 149 Max_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 2 150 Min_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 0 151 Average_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 1 159 DRAM_1_Bit_Error_Count 0x0000 100 100 000 Old_age Offline - 0 160 Uncorrectable_Error_Cnt 0x0000 100 100 000 Old_age Offline - 0 161 Valid_Spare_Block_Cnt 0x0000 100 100 000 Old_age Offline - 37 164 Total_Erase_Count 0x0000 100 100 000 Old_age Offline - 1487 165 Max_Erase_Count 0x0000 100 100 000 Old_age Offline - 6 166 Min_Erase_Count 0x0000 100 100 000 Old_age Offline - 2 167 Average_Erase_Count 0x0000 100 100 000 Old_age Offline - 2 169 Remaining_Lifetime_Perc 0x0000 100 100 000 Old_age Offline - 100 177 Wear_Leveling_Count 0x0000 100 100 050 Old_age Offline - 0 181 Program_Fail_Cnt_Total 0x0000 100 100 000 Old_age Offline - 0 182 Erase_Fail_Count_Total 0x0000 100 100 000 Old_age Offline - 0 192 Power-Off_Retract_Count 0x0000 100 100 000 Old_age Offline - 0 194 Temperature_Celsius 0x0000 043 063 000 Old_age Offline - 43 195 Hardware_ECC_Recovered 0x0000 100 100 000 Old_age Offline - 0 196 Reallocated_Event_Count 0x0000 100 100 016 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0000 100 100 050 Old_age Offline - 0 231 SSD_Life_Left 0x0000 100 100 000 Old_age Offline - 100 232 Available_Reservd_Space 0x0000 100 100 000 Old_age Offline - 100 241 Host_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 13512 242 Host_Reads_32MiB 0x0000 100 100 000 Old_age Offline - 0 245 TLC_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 24535 SMART Error Log Version: 1 Warning: ATA error count 0 inconsistent with error log pointer 1 ATA Error Count: 0 CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 0 occurred at disk power-on lifetime: 0 hours (0 days + 0 hours) When the command that caused the error occurred, the device was in an unknown state. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 00 ec 00 00 00 00 00 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- ec 00 00 00 00 00 00 00 00:00:00.000 IDENTIFY DEVICE ec 00 00 00 00 00 00 00 00:00:00.000 IDENTIFY DEVICE ec 00 00 00 00 00 00 00 00:00:00.000 IDENTIFY DEVICE ec 00 00 00 00 00 00 00 00:00:00.000 IDENTIFY DEVICE c8 00 00 00 00 00 00 00 00:00:00.000 READ DMA SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Extended offline Completed without error 00% 4 - SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay. The above only provides legacy SMART information - try 'smartctl -x' for more
I'm attaching the output of The SSD is in an Inateck enclosure currently connected over USB2. Does this indicate a problem with the drive, a glitch (cat tripping over the cable or something like that ;)) or an issue in smartmontools? |
|||
#1737 | fixed | JMicron ab12:34cd USB 3.0 Bridge needs -d sat | ||
Description |
Followup from here: https://www.smartmontools.org/ticket/338 dmesg log: [Jul14 17:50] usb 2-1: new SuperSpeed USB device number 6 using xhci_hcd [ +0.017371] usb 2-1: New USB device found, idVendor=ab12, idProduct=34cd, bcdDevice= 4.05 [ +0.000005] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ +0.000003] usb 2-1: Product: External Disk [ +0.000001] usb 2-1: Manufacturer: USB30 [ +0.000002] usb 2-1: SerialNumber: 01600000002D [ +0.005995] scsi host5: uas [ +0.000514] scsi 5:0:0:0: Direct-Access USB30 0405 PQ: 0 ANSI: 6 This hardware is a SATA to USB adapter enclosure. Exact model: Sveon STG064 Laptop Hard Drive 2.5 Inch Silver in Red (2.5 - Hard Drive, SATA, Serial ATA II, Serial ATA III, 9.5 mm, Hard Drive, 2.0/3.0 (3.1 Gen 1), Hard Drive) Purchase link: https://www.amazon.de/-/en/Sveon-STG064-Laptop-Drive-Silver/dp/B0798MCWL8 It requires some hard drive connected to SATA port when connecting the USB to the computer, otherwise dmesg does not output anything. Test: # smartctl -H /dev/sdf smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.4.6-arch1-1] (local build) Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org /dev/sdf: Unknown USB bridge [0xab12:0x34cd (0x405)] Please specify device type with the -d option. Use smartctl -h to get a usage summary This works fine: # smartctl -H /dev/sdf -d sat |
|||
#1735 | worksforme | Support for RaidSonic ICY BOX IB-1922MF-C32 USB to NVMe bridge (0x174c:0x2364, ASM2364) | ||
Description |
Hello, I'm unsure if this is a request for an enhancement or a case like "works as designed". So I apologize in advance if I'm wrong. I'm using two RaidSonic? ICY BOX IB-1922MF-C32 USB to NVMe bridges which have an ASMedia ASM2364 chipset inside. smartmontool is able to print out some information (please see attached outputs). But what moved me to open this ticket are the last lines of the output: Warning: NVMe Get Log truncated to 0x200 bytes, 0x200 bytes zero filled Error Information (NVMe Log 0x01, 16 of 256 entries) No matter what tests I run, I don't get any attributes displayed. Thank you in advance for your support! If you need additional information, outputs, ... please let me know! |
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