[rt-devel] Incorrect setting of Time Resolved with multiple inactive states?

Davide Imbeni davide at nabla2.it
Wed Apr 3 04:31:58 EDT 2013

Hello list,

I have a question / request regarding the setting of Resolved Time for a Ticket that changes status.
I read in the docs that:

RT will automatically set the Resolved date when a ticket's status is changed from an Initial or Active status to an Inactive status.

What I observed is instead that RT automatically set the Resolved date when a ticket's status is changed to an Inactive status, regardless of the original status.

This might seem a small distinction, but with my Lifecycle it makes an important difference.

We have implemented two different "final" states, the usual "resolved" and a following "closed", to keep track of the customer acknowledgement of the provided solution.
Both states are (and should be) inactive.
In our effort/time reports, we need to keep track of the time it took to resolve the ticket, i.e. we want to know when the status changed to "resolved".
When the ticket's status changes to "closed" is relatively irrelevant.

With the current code, unfortunately, the resolved time is changed at this last status change also.

I have implemented a tiny correction that solves the issue for us, but it's directly in the code (Ticket.pm), see below the diff:

--- Ticket.pm.orig	2013-04-02 17:14:45.000000000 +0200
+++ Ticket.pm	2013-04-02 17:44:38.000000000 +0200
@@ -3149,7 +3149,7 @@
     #When we close a ticket, set the 'Resolved' attribute to now.
     # It's misnamed, but that's just historical.
-    if ( $lifecycle->IsInactive($new) ) {
+    if ( $lifecycle->IsInactive($new) && !($lifecycle->IsInactive($old)) ) {
             Field             => 'Resolved',
             Value             => $now->ISO,

Now my questions: 
- Could this patch be incorporated in new releases of RT as a bugfix, or there are actual reasons for the current behavior I did not think about? 
- IF the latter is the case, are there better ways for us to patch the code than editing the actual file (and keep track of the patch at every update)?

Thanks for your help


--- Davide Imbeni, Nabla2 s.r.l.
--- Viale Monchio 116, 41124 Modena (MO) - Italy
--- Email: davide at nabla2.it

More information about the rt-devel mailing list