[rt-users] scrips...change due date on queue change

Thomas Sibley trs at bestpractical.com
Mon Dec 3 13:50:21 EST 2012

On 12/03/2012 10:30 AM, Telmo Cardoso wrote:
> This only fails on this line:
> my $curtime = $self->TicketObj->CreatedObj->Get( Timezone => 'server' );
> If I place my $curtime=time; it will work.

You probably want $self->TicketObj->CreatedObj->Unix.

Refer to http://bestpractical.com/rt/docs/4.0/RT/Date.html or `perldoc

> I have tried:
> my $curtime = $self->TicketObj->CreatedObj;

This returns an RT::Date object.

> and
> my $curtime = $self->TicketObj->CreatedObj->AsString;

This returns a localized string.

You may also be interested in looking at RT::Extension::SLA, which adds
business hour calculations to ticket due dates based on SLAs you define.

More information about the rt-users mailing list