Trac Ticket Queries

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.

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.

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:

Active tickets against 1.0

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:

Assigned tickets by owner

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:

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

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1240 worksforme CRUCIAL CT1000MX500SSD4 Laszlo
Description

Hi,

I hope this will be a useful addition to the database.

Regards,

Laszlo

#1239 fixed Limited SMART output on Samsung PM1633a when upgrading from smartctl 6.5 Doug Gilbert yhemery
Description

Hi,

When upgrading smartctl from version 6.6 to 7.0, most of the SMART informations are no longer displayed on a Samsung PM1633a. The inquiry is still working, but there is no selftest results, no phy details, and so on.

The server setup is :

  • Supermicro 2028R-DE2CR24L, with an embedded LSI 3008 HBA + an LSI SAS3x40 expander
  • 24x Samsung MZILS3T8HMLH/007 (PM1633a)
  • Debian 8 + custom kernel (4.19.67)

smartctl is compiled with the following arguments :

--with-nvme-devicescan --with-gnupg=no --with-initscriptdir=no --with-exampledir=no --with-drivedbdir=no --with-smartdscriptdir=no --with-smartdplugindir=no --with-systemdsystemunitdir=no

I added the output of the following commands, for both version 6.6 and 7.0 :

  • smartctl -x /dev/sda
  • smartctl -x /dev/sda -r ioctl,2

Feel free to ask if you need more details.

As a side note : Ticket #1225 might be the same issue, but I'm not sure of that.

#1238 duplicate Seagate Expansion 1Tb (ST1000LM035-1RK172) Tupã Negreiros
Description
smartctl 7.0 2018-12-30 r4883 [armv7l-linux-4.19.66-v7+] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     ST1000LM035-1RK172
Serial Number:    WDE3QSJA
LU WWN Device Id: 5 000c50 0a81a873c
Firmware Version: SBM3
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 T13/2161-D revision 3b
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Sun Sep 22 20:41:28 2019 -03
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is:   Unavailable
APM level is:     254 (maximum performance)
Rd look-ahead is: Enabled
Write cache is:   Enabled
DSN feature is:   Unavailable
ATA Security is:  Disabled, NOT FROZEN [SEC1]
Wt Cache Reorder: Enabled

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

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
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: 			 (0x71) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					No Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves 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: 	 (   1) minutes.
Extended self-test routine
recommended polling time: 	 ( 167) minutes.
Conveyance self-test routine
recommended polling time: 	 (   2) minutes.
SCT capabilities: 	       (0x3035)	SCT Status supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     POSR--   083   064   006    -    186481642
  3 Spin_Up_Time            PO----   098   098   000    -    0
  4 Start_Stop_Count        -O--CK   096   096   020    -    4449
  5 Reallocated_Sector_Ct   PO--CK   100   100   036    -    0
  7 Seek_Error_Rate         POSR--   078   060   045    -    66474940
  9 Power_On_Hours          -O--CK   097   097   000    -    3246 (13 246 0)
 10 Spin_Retry_Count        PO--C-   100   100   097    -    0
 12 Power_Cycle_Count       -O--CK   098   098   020    -    2172
184 End-to-End_Error        -O--CK   100   100   099    -    0
187 Reported_Uncorrect      -O--CK   100   100   000    -    0
188 Command_Timeout         -O--CK   100   096   000    -    30065295392
189 High_Fly_Writes         -O-RCK   100   100   000    -    0
190 Airflow_Temperature_Cel -O---K   061   043   040    -    39 (Min/Max 20/41)
191 G-Sense_Error_Rate      -O--CK   100   100   000    -    44
192 Power-Off_Retract_Count -O--CK   100   100   000    -    352
193 Load_Cycle_Count        -O--CK   079   079   000    -    43444
194 Temperature_Celsius     -O---K   039   057   000    -    39 (0 13 0 0 0)
197 Current_Pending_Sector  -O--C-   100   100   000    -    0
198 Offline_Uncorrectable   ----C-   100   100   000    -    0
199 UDMA_CRC_Error_Count    -OSRCK   200   200   000    -    0
240 Head_Flying_Hours       ------   100   253   000    -    1825 (3 138 0)
241 Total_LBAs_Written      ------   100   253   000    -    13438955871
242 Total_LBAs_Read         ------   100   253   000    -    17754401196
254 Free_Fall_Sensor        -O--CK   100   100   000    -    0
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning

General Purpose Log Directory Version 1
SMART           Log Directory Version 1 [multi-sector log support]
Address    Access  R/W   Size  Description
0x00       GPL,SL  R/O      1  Log Directory
0x01           SL  R/O      1  Summary SMART error log
0x02           SL  R/O      5  Comprehensive SMART error log
0x03       GPL     R/O      5  Ext. Comprehensive SMART error log
0x04       GPL,SL  R/O      8  Device Statistics log
0x06           SL  R/O      1  SMART self-test log
0x07       GPL     R/O      1  Extended self-test log
0x09           SL  R/W      1  Selective self-test log
0x10       GPL     R/O      1  NCQ Command Error log
0x11       GPL     R/O      1  SATA Phy Event Counters log
0x21       GPL     R/O      1  Write stream error log
0x22       GPL     R/O      1  Read stream error log
0x24       GPL     R/O    512  Current Device Internal Status Data log
0x30       GPL,SL  R/O      9  IDENTIFY DEVICE data log
0x80-0x9f  GPL,SL  R/W     16  Host vendor specific log
0xa1       GPL,SL  VS      24  Device vendor specific log
0xa2       GPL     VS    8160  Device vendor specific log
0xa8       GPL,SL  VS     136  Device vendor specific log
0xa9       GPL,SL  VS       1  Device vendor specific log
0xab       GPL     VS       1  Device vendor specific log
0xb0       GPL     VS    8920  Device vendor specific log
0xbe-0xbf  GPL     VS   65535  Device vendor specific log
0xc0       GPL,SL  VS       1  Device vendor specific log
0xc1       GPL,SL  VS      16  Device vendor specific log
0xc2       GPL,SL  VS     240  Device vendor specific log
0xc3       GPL,SL  VS       8  Device vendor specific log
0xc4       GPL,SL  VS      24  Device vendor specific log
0xc9       GPL,SL  VS       1  Device vendor specific log
0xca       GPL,SL  VS      16  Device vendor specific log
0xd3       GPL     VS    1920  Device vendor specific log
0xe0       GPL,SL  R/W      1  SCT Command/Status
0xe1       GPL,SL  R/W      1  SCT Data Transfer

SMART Extended Comprehensive Error Log Version: 1 (5 sectors)
No Errors Logged

SMART Extended Self-test Log Version: 1 (1 sectors)
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      3246         -
# 2  Short offline       Completed without error       00%      3245         -
# 3  Short offline       Completed without error       00%       684         -

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.

SCT Status Version:                  3
SCT Version (vendor specific):       522 (0x020a)
Device State:                        Active (0)
Current Temperature:                    39 Celsius
Power Cycle Min/Max Temperature:     20/42 Celsius
Lifetime    Min/Max Temperature:     13/57 Celsius
Specified Max Operating Temperature:    35 Celsius
Under/Over Temperature Limit Count:   0/0

SCT Temperature History Version:     2
Temperature Sampling Period:         1 minute
Temperature Logging Interval:        30 minutes
Min/Max recommended Temperature:     14/55 Celsius
Min/Max Temperature Limit:           10/60 Celsius
Temperature History Size (Index):    128 (122)

Index    Estimated Time   Temperature Celsius
 123    2019-09-20 05:00    37  ******************
 124    2019-09-20 05:30    37  ******************
 125    2019-09-20 06:00    37  ******************
 126    2019-09-20 06:30     ?  -
 127    2019-09-20 07:00    28  *********
   0    2019-09-20 07:30    38  *******************
   1    2019-09-20 08:00     ?  -
   2    2019-09-20 08:30    36  *****************
   3    2019-09-20 09:00    42  ***********************
   4    2019-09-20 09:30    44  *************************
   5    2019-09-20 10:00    43  ************************
   6    2019-09-20 10:30    44  *************************
   7    2019-09-20 11:00    44  *************************
   8    2019-09-20 11:30    46  ***************************
   9    2019-09-20 12:00    45  **************************
  10    2019-09-20 12:30    45  **************************
  11    2019-09-20 13:00    45  **************************
  12    2019-09-20 13:30    46  ***************************
  13    2019-09-20 14:00    47  ****************************
  14    2019-09-20 14:30    45  **************************
  15    2019-09-20 15:00    42  ***********************
  16    2019-09-20 15:30     ?  -
  17    2019-09-20 16:00    42  ***********************
  18    2019-09-20 16:30     ?  -
  19    2019-09-20 17:00    43  ************************
  20    2019-09-20 17:30     ?  -
  21    2019-09-20 18:00    42  ***********************
  22    2019-09-20 18:30     ?  -
  23    2019-09-20 19:00    42  ***********************
  24    2019-09-20 19:30    42  ***********************
  25    2019-09-20 20:00     ?  -
  26    2019-09-20 20:30    42  ***********************
  27    2019-09-20 21:00     ?  -
  28    2019-09-20 21:30    42  ***********************
  29    2019-09-20 22:00     ?  -
  30    2019-09-20 22:30    42  ***********************
  31    2019-09-20 23:00     ?  -
  32    2019-09-20 23:30    42  ***********************
  33    2019-09-21 00:00     ?  -
  34    2019-09-21 00:30    43  ************************
  35    2019-09-21 01:00     ?  -
  36    2019-09-21 01:30    43  ************************
  37    2019-09-21 02:00     ?  -
  38    2019-09-21 02:30    43  ************************
  39    2019-09-21 03:00     ?  -
  40    2019-09-21 03:30    42  ***********************
  41    2019-09-21 04:00     ?  -
  42    2019-09-21 04:30    42  ***********************
  43    2019-09-21 05:00     ?  -
  44    2019-09-21 05:30    42  ***********************
  45    2019-09-21 06:00     ?  -
  46    2019-09-21 06:30    42  ***********************
  47    2019-09-21 07:00     ?  -
  48    2019-09-21 07:30    42  ***********************
  49    2019-09-21 08:00     ?  -
  50    2019-09-21 08:30    42  ***********************
  51    2019-09-21 09:00     ?  -
  52    2019-09-21 09:30    42  ***********************
  53    2019-09-21 10:00     ?  -
  54    2019-09-21 10:30    42  ***********************
  55    2019-09-21 11:00     ?  -
  56    2019-09-21 11:30    30  ***********
  57    2019-09-21 12:00     ?  -
  58    2019-09-21 12:30    24  *****
  59    2019-09-21 13:00     ?  -
  60    2019-09-21 13:30    24  *****
  61    2019-09-21 14:00    45  **************************
  62    2019-09-21 14:30     ?  -
  63    2019-09-21 15:00    21  **
  64    2019-09-21 15:30     ?  -
  65    2019-09-21 16:00    21  **
  66    2019-09-21 16:30     ?  -
  67    2019-09-21 17:00    24  *****
  68    2019-09-21 17:30     ?  -
  69    2019-09-21 18:00    26  *******
  70    2019-09-21 18:30    30  ***********
  71    2019-09-21 19:00    44  *************************
  72    2019-09-21 19:30    45  **************************
  73    2019-09-21 20:00    45  **************************
  74    2019-09-21 20:30     ?  -
  75    2019-09-21 21:00    20  *
  76    2019-09-21 21:30    38  *******************
  77    2019-09-21 22:00    39  ********************
 ...    ..(  2 skipped).    ..  ********************
  80    2019-09-21 23:30    39  ********************
  81    2019-09-22 00:00    37  ******************
  82    2019-09-22 00:30    38  *******************
  83    2019-09-22 01:00    39  ********************
  84    2019-09-22 01:30    38  *******************
  85    2019-09-22 02:00    37  ******************
  86    2019-09-22 02:30    37  ******************
  87    2019-09-22 03:00    39  ********************
  88    2019-09-22 03:30    38  *******************
  89    2019-09-22 04:00    39  ********************
  90    2019-09-22 04:30    38  *******************
  91    2019-09-22 05:00    34  ***************
 ...    ..( 11 skipped).    ..  ***************
 103    2019-09-22 11:00    34  ***************
 104    2019-09-22 11:30    35  ****************
 105    2019-09-22 12:00    35  ****************
 106    2019-09-22 12:30    28  *********
 107    2019-09-22 13:00    35  ****************
 108    2019-09-22 13:30    36  *****************
 109    2019-09-22 14:00    35  ****************
 110    2019-09-22 14:30    35  ****************
 111    2019-09-22 15:00    35  ****************
 112    2019-09-22 15:30    38  *******************
 113    2019-09-22 16:00    41  **********************
 114    2019-09-22 16:30    36  *****************
 115    2019-09-22 17:00    37  ******************
 116    2019-09-22 17:30    36  *****************
 117    2019-09-22 18:00    35  ****************
 118    2019-09-22 18:30    39  ********************
 119    2019-09-22 19:00    39  ********************
 120    2019-09-22 19:30    39  ********************
 121    2019-09-22 20:00    37  ******************
 122    2019-09-22 20:30    39  ********************

SCT Error Recovery Control command not supported

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4            2172  ---  Lifetime Power-On Resets
0x01  0x010  4            3246  ---  Power-on Hours
0x01  0x018  6     13506033751  ---  Logical Sectors Written
0x01  0x020  6        63066061  ---  Number of Write Commands
0x01  0x028  6     17801130207  ---  Logical Sectors Read
0x01  0x030  6       120122755  ---  Number of Read Commands
0x01  0x038  6               -  ---  Date and Time TimeStamp
0x03  =====  =               =  ===  == Rotating Media Statistics (rev 1) ==
0x03  0x008  4            2773  ---  Spindle Motor Power-on Hours
0x03  0x010  4             193  ---  Head Flying Hours
0x03  0x018  4           43444  ---  Head Load Events
0x03  0x020  4               0  ---  Number of Reallocated Logical Sectors
0x03  0x028  4               0  ---  Read Recovery Attempts
0x03  0x030  4               0  ---  Number of Mechanical Start Failures
0x03  0x038  4               0  ---  Number of Realloc. Candidate Logical Sectors
0x04  =====  =               =  ===  == General Errors Statistics (rev 1) ==
0x04  0x008  4              21  ---  Number of Reported Uncorrectable Errors
0x04  0x010  4              31  ---  Resets Between Cmd Acceptance and Completion
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value

Pending Defects log (GP Log 0x0c) not supported

SATA Phy Event Counters (GP Log 0x11)
ID      Size     Value  Description
0x000a  2            1  Device-to-host register FISes sent due to a COMRESET
0x0001  2            0  Command failed due to ICRC error
0x0003  2            0  R_ERR response for device-to-host data FIS
0x0004  2            0  R_ERR response for host-to-device data FIS
0x0006  2            0  R_ERR response for device-to-host non-data FIS
0x0007  2            0  R_ERR response for host-to-device non-data FIS
1 2 3 4 5 6 7 8 9 10 11

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

Last modified 2 years ago Last modified on 11/12/2017 01:15:51 PM