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?
--------
RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26 & 27, 2011
*  San Francisco, CA, USA — October 18 & 19, 2011
*  Washington DC, USA — October 31 & November 1, 2011
*  Melbourne VIC, Australia — November 28 & 29, 2011
*  Barcelona, Spain — November 28 & 29, 2011

Reply via email to