[rt-users] advanced search w/ a sql call

Kenneth Marshall ktm at rice.edu
Mon Dec 20 12:55:35 EST 2010


On Mon, Dec 20, 2010 at 11:38:35AM -0500, Darin Perusich wrote:
> Hello,
> 
> I'd like to search for tickets created w/in the past 7 days which can be
> done easily enough by creating a query where Created after some day,
> "Created > '2010-12-13'". I'd like to make this more dynamic so I go
> into Advanced and change the Query to "Created > date_add(current_date,
> interval - 7 day)" and when I apply the changes I'm left on the Advanced
> query page and the format has been wiped out. Not what I was hoping for.
> 
> Are you allowed to enter straight SQL through the interface like this to
> make dynamic queries? Certainly I can see why this would not be allowed
> since it could lead to sql injection but I'm curious.
> 
> Also, is there a way to save such a report so I could just point to a
> URL or something of that nature to fire it off? Basically my manager
> wants a weekly report of all the tickets entered into RT and I'm trying
> to automate the creation of the report I give him.
> 
> Thanks!
> 
> RT 3.8.8 w/mysql
> 

You should be able to use something like "7 days ago" or
"-7 days" in the query.

Cheers,
Ken



More information about the rt-users mailing list