Rt command line, to see all tickets updated yesterday

Hello,

I’m trying to use the rt command line to get a list of all tickets that
were modified yesterday. I currently have:

rt ls -t ticket “Queue = ‘Support’ AND Status != ‘rejected’ AND
LastUpdated = '2009-05-06”

It seems simple enough, but apparently the query is larger than I had
anticipated, because the web server times out before returning any
results.

I’m looking for ideas/optimizations, to make this faster and more
reliable.

As an aside, I know I can add the -f switch to pull things like id, and
subject. Is there a way to pull info out of a customfield also? An
example:

rt ls -t ticket “Queue = ‘Support’ AND Status != ‘rejected’ AND
LastUpdated = ‘$EXPIRE’” -f id,subject,customfield

Any help or advice would be greatly appreciated.

Hello,

I’m trying to use the rt command line to get a list of all tickets that were
modified yesterday. I currently have:

rt ls -t ticket “Queue = ‘Support’ AND Status != ‘rejected’ AND LastUpdated
= '2009-05-06”

It seems simple enough, but apparently the query is larger than I had
anticipated, because the web server times out before returning any results.

I’m looking for ideas/optimizations, to make this faster and more reliable.

How many tickets do you have in support queue? For mysql ideal index
would be (Queue, LastUpdated), however I don’t think it’s the problem,
expecially if you have less than 100k tickets in the queue. Slow logs
may help you identify real bottleneck.

As an aside, I know I can add the –f switch to pull things like id, and
subject. Is there a way to pull info out of a customfield also? An
example:

rt ls -t ticket “Queue = ‘Support’ AND Status != ‘rejected’ AND LastUpdated
= ‘$EXPIRE’” -f id,subject,customfield

I don’t remember exact syntax, but it’s probably CustomField.{Name} or
something like that. Hope somebody come up with exact version :slight_smile:

Any help or advice would be greatly appreciated.

Best regards, Ruslan.