[rt-users] Getting SetTimeWorkedAutomatically Working in RT 4.2.9

geraldsnm geraldjunkmail at gmail.com
Tue Aug 2 05:03:51 EDT 2016

Hi Folks,

Our management is adamant about having time tracked automatically on

I've been banging my head against a wall for 2 months trying to get this to
work VIA pure SQL until I realized that the data model seems to not support
it. Specifically although there's a transaction logged every time the ticket
goes from open to stalled back to opened, there's no idea of a transaction
session so that if I try to write SQL that joins transaction to transaction,
and tries to subtract the latest time stamp for "opened" from the last
"opened" there's no way to determine which two "Opened" transactions
corelate to the transaction before it, so it ends up double counting
(imagine a ticket that goes from Opened, to Stalled, to Opened, to Stalled
and so-on), I end up having subtracting all latest records from the original
record so it double counts.

So I've tried to use the Scrips to do this, and noticed there's already a
user-contributed Scrip for "SetTimeWorkedAutomatically":


However I can't get this to work on my version of RT. First off, when I go
to create a Scrip there's no option for "Custom action cleanup code".

I only get 3x options for creating a Scrip:

"Custom Condition"

"Custom Action Preparation Code"


"Custom Action Commit Code"

I've tried pasting the perl script that's on the above URL into any of the
3x fields but RT errors and fails to compile the Scrip.

So I then tried to create a custom action with little success.

I can provide my code for the custom action.

Can anyone help out with this?

View this message in context: http://requesttracker.8502.n7.nabble.com/Getting-SetTimeWorkedAutomatically-Working-in-RT-4-2-9-tp62258.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.

More information about the rt-users mailing list