[rt-users] Setting Ticket Owner name

Kenneth Crocker KFCrocker at lbl.gov
Mon Oct 27 15:35:40 EDT 2008


To all,


	I'm trying to pre-set a ticket owner based on the value of an incoming 
CF that is set during ticket creation. What I have is this

Condition: On Create
Action: User-Defined
Template: Blank
Stage: TransactionBatch

Custom Action Prep Code:

my $ticket = $self->TicketObj;
return unless ($ticket->OwnerObj->Name() eq 'Nobody' );

Custom Action Cleanup Code:

# set up variables

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $org = $ticket->FirstCustomFieldValue('CF Name')

# condition setting owner ID on value of CF CF Name

if  ($org = 'XXX')
     {
      $ticket->SetOwner->Name('Persons User Name1', 'Force');
     }
elseif ($org = 'XY XY')
     {
      $ticket->SetOwner->Name('Persons User Name2', 'Force');
     }


return 1;

	The ticket owner is not being set. The ticket is created and all other 
fields, including the CF, are being created.
	Any ideas?  Thanks.


Kenn
LBNL




More information about the rt-users mailing list