[rt-users] Using CLI to Report Tickets Matching a Date Criteria

Ken O'Driscoll rt-lists at ieinternet.com
Tue Dec 7 12:41:24 EST 2004


On Tue, 2004-12-07 at 16:25, geno at onshore.net wrote:
> We have been using RT for a while now but have been worried about upgrading to
> version 3.
>   I work for an ISP and we use RT for our ticketing system and also
> have a monthly bonus that is based on the percentage of tickets closed each
> month.  For our current version we have a shell script that has the RT2 CLI
> reporting which tickets were created after the 1st of the month and prior to
> the first of the next month in certin queues and then report how many tickets
> were
> closed within that time period.  It takes both values and divides them to come
> up with the percentage resolved.  I'm having probelms figuring out the syntax
> in RT3's CLI.
[ ...snip...]

Based on my past experiences with the CLI, I think that I have a
horrible way of achieving what you want!  Here's how I'd do it:

Basically, first use the CLI to put a list of every ticket, regardless
of when it was created, into an array e.g. TICKETS="`rt ls -i`"

Then write a loop (for ID in $TICKETS) and go though the array (rt show
-t ticket -f Created,Status $ID) You can manipulate the output of this
command to only get the dates and ticket statuses which you want.

You could probably save the last state of $ID to a file so that the next
time you ran the script, you started from where you left off.

I hope this makes sense.

 - Ken.



--
This email has passed through an IE Internet MailWall gateway
and has been screened for known viruses, potential viruses and
malicious code.

IE Internet.com MailWall (http://ieinternet.com/mailwall/)
--




More information about the rt-users mailing list