Discussion:
[rt-users] excluding queue in RT SQL
Alex Hall
2017-02-09 15:02:08 UTC
Permalink
Hi all,
Just a quick question, and one I feel like I should know. In RT's
implementation of SQL, how do I specify a queue; name or ID?

We have a cron job that runs, using SQL to search for tickets. I'm being
asked to exclude a specific queue from this search. Do I need to use "queue
<> 'queue name'" or "queue <> 7"? Thanks.
--
Alex Hall
Automatic Distributors, IT department
***@autodist.com
Matt Zagrabelny
2017-02-09 15:47:59 UTC
Permalink
Hey Alex,
Post by Alex Hall
Hi all,
Just a quick question, and one I feel like I should know. In RT's
implementation of SQL, how do I specify a queue; name or ID?
Just a point of clarification: RT has something called TicketSQL and
while "SQL" is in its name, it is not SQL.

That being said, you want the queue's name.
Post by Alex Hall
We have a cron job that runs, using SQL to search for tickets. I'm being
asked to exclude a specific queue from this search. Do I need to use "queue
<> 'queue name'" or "queue <> 7"? Thanks.
I would build some of the query with the search builder:

Search -> Tickets -> New Search

Add a few predicates to your search and then click Advanced. You'll
see exactly what TicketSQL RT uses.

-m

Loading...