Ticket Collection via List of Ticket IDs

Ok,

I have spent a bit of time looking, but have not found a simple solution.

Is there a simple way to call the Search Result.html page with a list of
Ticket IDs and have the page display the list of tickets? This would be
similar to the CLI option of:

rt show ticket/3

Thanks,

Joel Hartshorn

smime.p7s (3.28 KB)

I need this all server side in PERL.

A better CLI “Input” example would be:

rt show ticket/3,4,5,6 where 3,4,5,6 are Ticket IDs

It would be very useful to do something like:

Result.html?ids=1:2:3:4:5 in the querystring…

However, if I can’t get that, I was hoping to duplicate the functionality of
Result.html with something like:

my $tickets = RT::Tickets->new(1,2,3,4,5);

That would be extremely useful.-----Original Message-----
From: Yedidyah Bar-David [mailto:didi@isoc.org.il]
Sent: Tuesday, September 08, 2009 12:23 PM
To: Joel Hartshorn
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Ticket Collection via List of Ticket IDs

On Tue, Sep 08, 2009 at 11:34:18AM -0700, Joel Hartshorn wrote:

Ok,

I have spent a bit of time looking, but have not found a simple solution.

Is there a simple way to call the Search Result.html page with a list
of Ticket IDs and have the page display the list of tickets? This
would be similar to the CLI option of:

rt show ticket/3

Thanks,

Joel Hartshorn

Using the Query Builder (“Edit Search”), you can build a search that says
"id is number1" OR “id is number2” etc. Then you’d get a results page, and
if you then press “Bookmarkable link” you get it with GET params, which
after editing out the irrelevant parts, can be reduced to
http://your.domain/Search/Results.html?Query= id = num1 OR id = num2
Didi

smime.p7s (3.28 KB)

If only TicketSQL/DIBx::SearchBuilder supported IN(): id IN(37,42,86)

Cambridge Energy Alliance: Save money. Save the planet.

Ok,

I have spent a bit of time looking, but have not found a simple solution.

Is there a simple way to call the Search Result.html page with a list of
Ticket IDs and have the page display the list of tickets? This would be
similar to the CLI option of:

rt show ticket/3

Thanks,

Joel Hartshorn

Using the Query Builder (“Edit Search”), you can build a search that says
"id is number1" OR “id is number2” etc. Then you’d get a results page, and
if you then press “Bookmarkable link” you get it with GET params, which
after editing out the irrelevant parts, can be reduced to
http://your.domain/Search/Results.html?Query= id = num1 OR id = num2
Didi

If only TicketSQL/DIBx::SearchBuilder supported IN(): id IN(37,42,86)

Someone sent a patch to Jifty::DBI for that and it should be
relatively easy to backport. But that wouldn’t fix TicketSQL or the
FromSQL method which is how I would be implementing this.

-kevin

EXACTLY!!!

Joel Hartshorn
Internet Engineer/New Media
The Seattle Times Company
206 464 2323
nwsource.com | seattletimes.com-----Original Message-----
From: Jerrad Pierce [mailto:jpierce@cambridgeenergyalliance.org]
Sent: Tuesday, September 08, 2009 7:17 PM
To: Joel Hartshorn
Cc: Yedidyah Bar-David; rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Ticket Collection via List of Ticket IDs

If only TicketSQL/DIBx::SearchBuilder supported IN(): id IN(37,42,86)

Cambridge Energy Alliance: Save money. Save the planet.

smime.p7s (3.28 KB)

If only TicketSQL/DIBx::SearchBuilder supported IN(): id IN(37,42,86)
I actually took a stab at implementing this last night, and it’s no mean feat
since you have to severly alter the parsing engine in RT::SQL (and
make some minor changes to RT::Tickets_Overlay).

Although not as elegant, nor as efficient for the db, I’m considering
creating an extension that uses an callback to turn the IN syntax into
an expanded OR alternation if nobody comes up with anything better.
Alas, that’d only change simple search/query string processing, and not
Ticket Builder/ Advanced Edit, which is where I most often need IN() myself…

… Queue NOT IN (‘Spool’, ‘SPAM’, ‘TODO’)

I’ll try to checkout the Jifty::DBI patch too, to see if it does enough of
the heavy-lifting.

-Jerrad
Cambridge Energy Alliance: Save money. Save the planet.

If only TicketSQL/DIBx::SearchBuilder supported IN(): id IN(37,42,86)
I actually took a stab at implementing this last night, and it’s no mean feat
since you have to severly alter the parsing engine in RT::SQL (and
make some minor changes to RT::Tickets_Overlay).

Although not as elegant, nor as efficient for the db, I’m considering
creating an extension that uses an callback to turn the IN syntax into
an expanded OR alternation if nobody comes up with anything better.
Alas, that’d only change simple search/query string processing, and not
Ticket Builder/ Advanced Edit, which is where I most often need IN() myself…

… Queue NOT IN (‘Spool’, ‘SPAM’, ‘TODO’)

I’ll try to checkout the Jifty::DBI patch too, to see if it does enough of
the heavy-lifting.

The JDBI patch only implements it at the JDBI level.
As you’ve noted, the actual complexity is in the TicketSQL parser
Frankly I just write the map/join when I need an alternating condition

-kevin