Hello all,<div><br></div><div>Awhile back I set up a custom global scrip to auto-set the owner of a ticket to the user like this:</div><div><br></div><div>On Create, action user defined, Global template: Blank, Stage TransactionCreate</div>
<div><br></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 10px; line-height: 12px; background-color: rgb(239, 239, 239); ">Custom action preparation code:</span></div>
<div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 10px; line-height: 12px; background-color: rgb(239, 239, 239); "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 10px; line-height: 12px; background-color: rgb(239, 239, 239); "> return 1;</span></div>
<div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 10px; line-height: 12px; background-color: rgb(239, 239, 239); "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 10px; line-height: 12px; background-color: rgb(239, 239, 239); ">Custom action cleanup code:</span></div>
<div><span class="Apple-style-span" style="background-color: rgb(239, 239, 239); line-height: 12px;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="1"><div># get actor ID</div><div>my $Actor = $self->TransactionObj->Creator;</div>
<div><br></div><div># if actor is RT_SystemUser then get out of here</div><div>return 1 if $Actor == $RT::SystemUser->id;</div><div><br></div><div># get out unless ticket owner is nobody</div><div>return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;</div>
<div><br></div><div># ok, try to change owner</div><div>$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #".$Actor );</div><div>  my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );</div>
<div>unless( $status ) {</div><div>  $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );</div><div>  return undef;</div><div>}</div><div>return 1;</div><div><br></div></font></span>Honestly this is a holdover from another scrip I have that changes the owner of a ticket to the user whenever the ticket is commented on.  This is working good except that it doesn't seem to work for child tickets.  They still inherit the parent's owner as their own.  Anybody know where this is going awry?</div>