Time Left

This may be something simple, but it does not appear that the “Time
Left” field gets updated automatically as people make changes to the
time worked as each comment is appended to a ticket.

If Time Left does not get updated automatically, it does not seem to be
that useful of a field.

Has anyone tried this?

Has anyone set up the Time Left field to auto-populate based on the Due Date?
I’m trying to figure out how to best go about this.

I’m thinking that I could updated it similar to how the priority gets escalated
every night when either the rt-crontool or rt-escalate runs. However, it would
be nice to have it set up to update every hour if I displayed days - hours or
what have you.

If anyone could offer some thoughts if they’ve done it themselves I’d appreciate it.

Thanks
Mathew
Keep up with me and what I’m up to: http://theillien.blogspot.com

Correction:

As Time Left is in minutes, all I need to figure out is how to set it initially.
I would assume that I need to grab the due date and Diff it with the current
time. However, the scrip I’ve cobbled together clearly isn’t the way to do it
as it doesn’t work :wink:

Condition: On Create
Action: User Defined
Template: Global template: Blank

Custom action preparation code:
my $date = new RT::Date($self->CurrentUser);
$date->Set(Format => ‘unix’, Value => time);
my $dueIn = DiffAsString($date);

$self->TicketObj->SetTimeLeft($dueIn);

Maybe my logic is flawed. Or it could be that I’ve never actually written a
scrip before so I’m likely screwing it all up. Either way, any help will be
appreciated.

Thanks
Mathew
Keep up with me and what I’m up to: http://theillien.blogspot.com

Mathew Snyder wrote: