[rt-users] CLI Scripting Question

Kevin Falcone falcone at bestpractical.com
Thu Dec 8 13:50:09 EST 2011


On Wed, Nov 30, 2011 at 09:28:53AM +0100, Nehmer Torben wrote:
> Hi,
> 
> > It wouldn't work. Most times it's easier to use
> > $tickets->FromSQL("Queue = 'x' AND (Status ...)") instead of Limit*
> > calls. LIKE adding % around arguments is historical thing. Use
> > MATCHES.
> 
> Using OPERATOR => 'MATCHES' produces an error:
> 
> [Wed Nov 30 08:15:28 2011] [error]: RestrictionsToClauses: Invalid operator MATCHES for Subject (STRING) at /usr/share/request-tracker4/lib/RT/Tickets.pm line 3363. (/usr/share/request-tracker4/lib/RT/Tickets.pm:3416)
> 
> MATCHES in FromSQL does effectively break the entire query, LIKE in FromSQL has the same bahvoir as LimitSubject.
> 
> Besides, I find it much more error prone to build SQL queries by hand.
> 
> So I am still where I started.
> 
> It can't be that hard to do a query the subject for a string on the beginning without patching the Perl SearchBuilder modules itself, can it?

You want OPERATOR => 'STARTSWITH', documented in DBIx::SearchBuilder
on the Limit method.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111208/04a89a79/attachment.sig>


More information about the rt-users mailing list