Hi again,

I would really like if someone could help me with this question, because
its not hard, but its not working dunno why.

I'm chaging due dates on queue change, based on ticket creation date.

I have the following scrips:
Condition: On Queue Change
Action: User Defined
Template: Blank
Stage: TransactionCreate

Custom action cleanup code:
my $duedate = RT::Date->new($RT::SystemUser);
my $hoursuntildue = 27;
if ($self->TicketObj->QueueObj->Name eq "queueName") {
$hoursuntildue = 9;
} else {
$hoursuntildue = 27;
}
use Business::Hours;
my $hours = Business::Hours->new();
my $curtime = $self->TicketObj->CreatedObj->Get( Timezone => 'server' );
my $bus_hours_duetime = $hours->add_seconds ($curtime,
($hoursuntildue*60*60));
$duedate->Set(Format=>'unix', Value=>$bus_hours_duetime);
$self->TicketObj->SetDue($duedate->ISO);
return 1;


This only fails on this line:
my $curtime = $self->TicketObj->CreatedObj->Get( Timezone => 'server' );

If I place my $curtime=time; it will work. I have tried:
my $curtime = $self->TicketObj->CreatedObj;
and
my $curtime = $self->TicketObj->CreatedObj->AsString;

any help?

Thanks


   Telmo Cardoso
--------
We're hiring! http://bestpractical.com/jobs

Reply via email to