[rt-users] easy way to display complete ticket history via RT CLIshell
Gabriel Cadieux
gcadieux at securetechnologies.ca
Wed Oct 29 13:35:31 EDT 2008
forgot to add, i also need the date and time associated with each history event and its subsequent attachments :(
i also can't find a way to correlate all this info into one big nice block of stuff i can include in my final output.
thx!
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com]On Behalf Of Gabriel
Cadieux
Sent: Wednesday, October 29, 2008 12:58 PM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] easy way to display complete ticket history via RT
CLIshell
hey all,
using RT 3.6.7..
i'm creating a shell script that will be called by an php page where an employee here can enter a service work order ticket number and then the script will use the RT shell to generate a nicer, customer-friendly version of the ticket, adding certain things (like a place for the custy to sign and date on reception), also ommiting certain unnecessary information, and formatting it to be printable, and more importantly, more presentable ro the customer than printing out an RT ticket straight from a browser.
now, i can manage to do a basic query on a ticket given the number...
'show ticket/<number>' let's say..
but that doesn't show me the ticket history.
'show ticket/<number>/history' is great, but the CONTENT (or so-called 'attachments') isn't displayed, and it also doesn't TELL me if any of these items have attachments in them so that i can in turn query them using the 'show ticket/<number>/attachments/<atch_number>/content'...
i'm very confused as to how useful this can possibly be to me at this point.. i'm starting to wonder if it will even be possible to make what i'm trying to do..
now, my question is: is there an easy way to get the rt shell (or anything else) spit out a list of the entire ticket history, WITH attachment content (such as a 'global summary of events') for a specific ticket, so that i can just slap that info onto the footer of my page and not have to break my head open trying to parse and process all this stuff manually?
for example, i'd like to be able to issue a single command, and be given, just like in RT:
# Wed Oct 29 12:32:40 2008 gabe - Ticket created
Customer wants an eval for a firewall.
# Wed Oct 29 12:32:57 2008 gabe - Status changed from 'new' to 'open'
# Wed Oct 29 12:38:46 2008 gabe - Taken
or whatever the ticket history is, in FULL..
the problem is, i could technically do all of this with a shitload of partsing via awk and whatnot or maybe in perl with some string stuff, but then i still couldn't associate ticket history entries with their appropriate 'attachments' (i.e. their content), which is what is most important when there are notes in the tickets...
please help, this is really important otherwise the whole point of using RT to create and manage our service work orders will go down the toilet... i need to be able to access the ticket info externally (preferably using the RT CLI shell since it already implements the ticketSQL stuff), and then make a nicey-looking printable HTML page out of it.. i will do the formatting and selection of what fields i want manually for the header of it (all the custy address info, status of work order, etc..), but i need the history in whole, so ppl can see what was done with the ticket.
btw, we don't use RT emailing at ALL. i have completely disabled emailing anything to anyone, we're using this as a simple in-house ticket tracking solution.
thanks so much in advance.
-gabe
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: sales at bestpractical.com
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
More information about the rt-users
mailing list