[rt-users] Auto-setting the owner of "child" tickets

Chris Hall hiro24 at gmail.com
Tue Aug 16 11:45:39 EDT 2011


Hello all,

Awhile back I set up a custom global scrip to auto-set the owner of a ticket
to the user like this:

On Create, action user defined, Global template: Blank, Stage
TransactionCreate

Custom action preparation code:

 return 1;

Custom action cleanup code:
# get actor ID
my $Actor = $self->TransactionObj->Creator;

# if actor is RT_SystemUser then get out of here
return 1 if $Actor == $RT::SystemUser->id;

# get out unless ticket owner is nobody
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;

# ok, try to change owner
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user
#".$Actor );
  my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
unless( $status ) {
  $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
  return undef;
}
return 1;

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110816/715dccc2/attachment.htm>


More information about the rt-users mailing list