TicketSQL is RT's loose variant of SQL that you can use for composing custom queries by hand:
- in RT's web interface on the Query Builder page (click Advanced)
- on the command-line: [$RTHOME/bin/rt-crontool UseRtCrontool] or [$RTHOME/bin/rt UseRtTool], the general-purpose command-line tool
- in RT's Perl API
If you would like to search for the current user, you can click Advanced and enter something like
(Owner = '__CurrentUser__')
Valid operators include:
- < (less than)
- <= (less than or equal to)
- = (equals)
- != (not equal to)
- > (greater than)
- >= (greater than or equal to)
There are at least three valid date formats:
- 'today' uses today's date as the date value
- 'x days ago' where x is some integer value (e.g. 8 days ago)
- 'yyyy-mm-dd'' absolute day in the format year-month-date (e.g. 1898-03-13)
Tickets in the General queue that are new or open and owned by joe:
(Status = 'new' OR Status = 'open') AND Queue = 'General' AND owner = 'joe'
Searching by date:
Created > '7 days ago' AND Queue = 'General' Status = 'stalled' AND Due <= 'today'
Accessing custom fields:
Status = 'resolved' AND CF.YourCustomField = 'somevalue'
Tickets that have no members (children):
HasMember = 'NULL'
Tickets that depend on at least one other ticket:
DependsOn != 'NULL'