[rt-users] SCRIP User Defined Actions
    Ruslan U. Zakirov 
    cubic at acronis.ru
       
    Wed Oct 22 12:18:08 EDT 2003
    
    
  
Jeff Klassen wrote:
> Hi Ruslan,
> 
> Thanks for the code here. I set this up as seemed correct, but the action
> does not happen. Just to confirm, I have added a scrip using the Queue
> Configuration tool as follows:
> 
> Description: Set region field
> Condition: On Create
> Custom Condition: <none>
> Action: User Defined
> Custom action preparation code:
>      return 1;
> Custom action cleanup code:
>      my ($status, $msg) = $self->TicketObj->_AddCustomFieldValue(
> 		Field => 'Region',
> 		Value => 'UBS Europe/Middle East',
> 		RecordTransaction => 0
> 	);
>      die $msg unless ($status);
>      return 1;
> Template: Global template: Blank
> 
> Can you see anything wrong with this setup?
Sorry. I didn't test that. Next one right
Custom action cleanup code:
      my $cf_name = 'Region';
      my $cf = RT::CustomField->new($RT::SystemUser);
      $cf->LoadByNameAndQueue(Name => $cf_name,
               Queue => $self->TicketObj->Queue);
      die "No such CustomField '$cf_name'" unless($cf->id);
      my ($status, $msg) = $self->TicketObj->_AddCustomFieldValue(
		Field => $cf,
		Value => 'Value',
		RecordTransaction => 0
	);
      die $msg unless ($status);
      return 1;
	Good luck.
> 
> Thanks again.
> 
> jeff
> 
> 
    
    
More information about the rt-users
mailing list