<p dir="ltr">Hi all,</p>
<p dir="ltr">Any help here means alot! Im on the latest version of RT.</p>
<p dir="ltr">What I want to do is, I want the script to automatically set the owner based on the custom field which there are a few users that need made owner of certain values.</p>
<p dir="ltr"> The example script that I have is as follows however it doesn’t work? ;</p>
<p dir="ltr"> </p>
<p dir="ltr">#---------------------------------------------------------------------------- <br>
# Custom action Preparation Code: <br>
#---------------------------------------------------------------------------- <br>
# <br>
# set new ticket owner id value <br>
# <br>
# 42 - Frank <br>
# 148 - Bob <br>
# 5125 - Sally <br>
# 9324 - Roberta <br>
# 73886 - Ted <br>
# </p>
<p dir="ltr">my %orgs = qw( <br>
Budget-Direct 148 <br>
Budget-Indirect 148 <br>
Controller-AP 5125 <br>
Controller-AR 73886 <br>
Controller-GA 148 <br>
Controller-PR 42 <br>
Facilities 42 <br>
Field OPS 42 <br>
OCFO-Other 42 <br>
Procurement 9324 <br>
Property 9324 <br>
SPO 73886 <br>
Travel 5125 <br>
Other 42 <br>
); </p>
<p dir="ltr">my $cf = new RT::CustomField($RT::SystemUser); <br>
$cf->LoadByName(Queue => $ticket->QueueObj->id,Name => "CFO-Org"); <br>
return 0 unless $cf->id; <br>
my $cfvalue = $ticket->FirstCustomFieldValue('CFO-Org'); <br>
my $ownerid = $orgs{$cfvalue}; </p>
<p dir="ltr"># set Ticket Due date & Owner ID </p>
<p dir="ltr">$ticket->SetOwner($ownerid); </p>
<p dir="ltr">return 1; <br>
#---------------------------------------------------------------------------- <br>
# Custom action Cleanup Code: <br>
#---------------------------------------------------------------------------- </p>
<p dir="ltr">return 1; </p>
<p dir="ltr"> <br>
Any help would mean a great deal,</p>
<p dir="ltr">Many Thanks,</p>
<p dir="ltr">Jordan</p>