[rt-users] Time Left

Mathew Snyder theillien at yahoo.com
Tue Jun 26 14:30:58 EDT 2007


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 ;)

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:
> 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



More information about the rt-users mailing list