I’m using the RT::Extension::Nagios plugin and would like for
statistics purposes for my IT director
to have the total time worked calculated from all the previously
created problem merged tickets
when the recovery ticket is resolved.
What I can see so far: a ticket is created from ‘PROBLEM’ mail subject
and successive ‘PROBLEM’ tickets merge
previous tickets into them until we receive a ‘RECOVERY’ ticket and
that last (new) ticket ID is resolved.
What I think I need is to get the ticket history of the resolved
ticket ID and get the oldest transaction ID
from that and get the date created then calculate the difference
between the two dates using Date::Calc?
To demonstrate I have at least tried (but time is limited by
management) hence this mail.
I see one can use the rt shell or RT::Client::REST to get the required history.
rgabriel@orpheus:~/tmp$ rt show ticket/11113/history
151090: Ticket created by firstname.lastname@example.org
151091: Outgoing email recorded by RT_System
151096: Ticket created by email@example.com
151097: Outgoing email recorded by RT_System
151098: Merged into ticket #11113 by RT_System
rgabriel@orpheus:~/tmp$ rt show ticket/11113/history/id/151124
Description: Status changed from ‘new’ to ‘resolved’ by RT_System
Content: This transaction appears to have no content
Created: 2010-02-24 07:46:43
I suppose one could set TimeWorked from this.
I’ve tried using SetTimeWorkedAutomatically as a queue scrip but now I
see it is no good.
I’m learning how RT does things and it’s not as expected.
I would like to know what is the most logical way of going about this?
I’ve tried looking at
/opt/rt3/share/html/Ticket/Elements/ShowHistory and adding some of that to
but I’m digging the hole deeper. I’m not going to investigate the Perl
internals of RT quite right now.
I could hack a dirty solution together using shell scripts etc. but I
want something clean and elegant.