[rt-users] unable to form query in TicketSQL; can RT do SQL?

Robert Kleemann kleemann at scharp.org
Sun Aug 12 15:02:26 EDT 2007


I'm trying to do the query "show me any tickets that I've touched in any 
way in the past three weeks." I've tried to use the query ui and 
TicketSQL but couldn't find a query that worked.

I have access to the postgres DB that runs our RT system so I was able 
to form the following SQL query that works:

select distinct foo.id, tickets.subject from (
  select  transactions.objectid, transactions.created, tickets.id
  from transactions, tickets
  where
  transactions.creator=(select users.id from users where name='kleemann')
  and objecttype='RT::Ticket'
  and transactions.created > (now()- interval '3 weeks')
  and transactions.objectid = tickets.id
) as foo, tickets
where foo.id=tickets.id
;

I'd like to have the query results available in RT so I could have a 
list of ticket links. Is there a way to make RT use a query like this? 
Is there an easier way to do this?

thanks!
Robert.



More information about the rt-users mailing list