My mistake, the custom action commit code is this: # get actor ID my $Actor = $self->TransactionObj->Creator;
# ok, try to change owner $RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #".$Actor ); my ($status, $msg) = $self->TicketObj->SetOwner( $Actor,'Force' ); unless( $status ) { $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" ); return undef; } return 1; On Tue, Nov 5, 2013 at 12:10 PM, Chris Hall <hir...@gmail.com> wrote: > This is my scrip that sets the owner to themselves after a comment. Like > I said though it's working fine. However, something else seems to be > kicking off now afterwards that is giving the ticket back to the previous > owner. > > > Condition: On Create > Action: User Defined > Template: Blank > > Custom Condition: <BLANK> > > Custom action preparation code: > return 1; > > Custom action commit 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; > > > > On Tue, Nov 5, 2013 at 12:03 PM, Alex Vandiver > <ale...@bestpractical.com>wrote: > >> On Tue, 2013-11-05 at 11:40 -0500, Chris Hall wrote: >> > I'm noticing a strange problem after my upgrade from 4.0.0 to 4.2. >> > Before my upgrade I'd made a global script that would have the user >> > attempt to take ownership of a ticket after commenting on it. This is >> > still working after the upgrade. However, now it is immediately given >> > back to the previous owner for some reason. History reads like this: >> > >> > >> > >> > >> > # The RT System itself - Owner forcibly changed from UserA to UserB >> > # UserB - Given to UserA >> > >> > >> > Any ideas what might be causing this and how to stop it? >> >> You will need to provide the scrip before we will be able to hazard any >> guesses. >> - Alex >> >> >