Hi again,<br><br>I would really like if someone could help me with this question, because its not hard, but its not working dunno why.<br><br>I'm chaging due dates on queue change, based on ticket creation date.<br><br>
I have the following scrips:<br>Condition: On Queue Change<br>Action: User Defined<br>Template: Blank<br>Stage: TransactionCreate<br><br>Custom action cleanup code:
<br>my $duedate = RT::Date->new($RT::SystemUser);<br>my $hoursuntildue = 27;<br>if ($self->TicketObj->QueueObj->Name eq "queueName") {<br>$hoursuntildue = 9;<br>} else {<br>$hoursuntildue = 27;<br>}<br>
use Business::Hours;<br>my $hours = Business::Hours->new();<br>my $curtime = $self->TicketObj->CreatedObj->Get( Timezone => 'server' );<br>my $bus_hours_duetime = $hours->add_seconds ($curtime, ($hoursuntildue*60*60));<br>
$duedate->Set(Format=>'unix', Value=>$bus_hours_duetime);<br>$self->TicketObj->SetDue($duedate->ISO);<br>return 1;<br><br><br>This only fails on this line:<br>my $curtime = $self->TicketObj->CreatedObj->Get( Timezone => 'server' );<br>
<br>If I place my $curtime=time; it will work. I have tried:<br>my $curtime = $self->TicketObj->CreatedObj;<br>and<br>my $curtime = $self->TicketObj->CreatedObj->AsString;<br><br>any help?<br><br>Thanks<br>
<br><br clear="all"> Telmo Cardoso<br>