Reputation: 2862
I need our ticket system Request tracker from Best practical to search for all queues and return list of them. They could change and I do not want to hardcode them in source code or config files.
Is there search query for it?
search/queue?query=...
gives
RT/4.0.7 500 Server Error
Unsupported object type.
Or how can I modify ticket system to return list of all queues?
Ticket system: http://bestpractical.com/rt/
Thanks for suggestions
Upvotes: 3
Views: 2327
Reputation: 108
The following links are working in 4.4.0.
/REST/1.0/search/user?query=
/REST/1.0/search/group?query=
/REST/1.0/search/queue?query=
Upvotes: 2
Reputation: 299
As others wrote, you can use the RT REST1 API or it's newer version (REST2 API). But it needs some configuration before. Then something like
https://your_rt_server/REST/1.0/search/queue?query=
https://your_rt_server/REST/2.0/queues/all
should work.
Perhaps more straight-forward way is to use the PERL API if you have the access to the filesystem of the RT server. Then it should work like this:
#!/usr/bin/env perl
use lib ("/opt/rt4/lib");
use strict;
use warnings;
use 5.010;
use RT -init;
my $queues = RT::Queues->new($RT::SystemUser);
$queues->UnLimit;
while (my $queue = $queues->Next){
say $queue->Name;
}
Upvotes: 0
Reputation: 21
REST/1.0/search/queue
exists in newer RT releases (4.2.2 and later).
Upvotes: 2
Reputation: 171
As far as I know the query you are looking for is not available in the RT REST api. From a similar question on the RT Users list:
RT's REST API is intended mostly for working with tickets (the query is actually TicketSQL as available in the normal Query Builder UI).
If you need to work with and modify other RT objects, you'll want to use RT's perl API.
http://lists.bestpractical.com/pipermail/rt-users/2011-October/073272.html
Upvotes: 1