[rt-users] Update DueDate on CF modification

Alex Young AlexYoung at HousingPartners.co.uk
Fri Feb 15 07:24:10 EST 2013


Hi. I'm using RT 4.0.5. I am trying to update the DueDate field with the
contents of a custom field with the datetime content. IT works fine on
creation of the ticket if I set the condition to "On Transaction" or "On
Create" but it doesn't update the DueDate field if the CF is modified
later. Any ideas how I can update DueDate when the CF is modified?

My scrip is:
Condition: On Transaction
Action: User defined
Template: Global template: Blank
Stage: TransactionCreate (Also tried TransactionBatch)
Custom Condition:
return 1;
Custom action prep code:
return 1;
Custom action cleanup code:
## Turns into yyyy-mm-dd format for date conversion by RT::Date 
my $trans = $self->TransactionObj; 
my $ticket = $self->TicketObj; 
my $cf_date = $ticket->FirstCustomFieldValue('Deployment DateTime'); 

my $duedate = RT::Date->new($RT::SystemUser); 
$duedate->Set(Format=>'unknown', Value=>$cf_date); 

$ticket->SetDue($duedate->ISO);

Thanks.



More information about the rt-users mailing list