[rt-users] Searching for a tickets with a filename

Thomas Sibley trs at bestpractical.com
Thu Sep 13 12:37:53 EDT 2012


On 09/13/2012 07:31 AM, Robert Blackwell wrote:
> I have a problem where I need to search for tickets by attached file name.
> I am doing this currently by doing a SQL search against the database.
> 
> Is there a way to do this via the API that I am missing?

The Query Builder and hence TicketSQL support Filename:

    Queue = 'rt3' and Filename LIKE '.patch' and Status != 'resolved'

for example.  You use $tickets->FromSQL(...) for TicketSQL via the API.

You'll probably want to add an index against Filename if you can for
better performance, but EXPLAIN your queries to see if that's necessary
and how much it helps.



More information about the rt-users mailing list