<div dir="ltr">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.<div>
<br></div><div><br></div><div><div>Condition: On Create</div><div>Action: User Defined</div><div>Template: Blank</div><div><br></div><div>Custom Condition: <BLANK></div><div><br></div><div>Custom action preparation code: </div>
<div> return 1;</div><div><br></div><div>Custom action commit code:</div><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><div><br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 5, 2013 at 12:03 PM, Alex Vandiver <span dir="ltr"><<a href="mailto:alexmv@bestpractical.com" target="_blank">alexmv@bestpractical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, 2013-11-05 at 11:40 -0500, Chris Hall wrote:<br>
> I'm noticing a strange problem after my upgrade from 4.0.0 to 4.2.<br>
> Before my upgrade I'd made a global script that would have the user<br>
> attempt to take ownership of a ticket after commenting on it. This is<br>
> still working after the upgrade. However, now it is immediately given<br>
> back to the previous owner for some reason. History reads like this:<br>
><br>
><br>
><br>
><br>
> # The RT System itself - Owner forcibly changed from UserA to UserB<br>
> # UserB - Given to UserA<br>
><br>
><br>
> Any ideas what might be causing this and how to stop it?<br>
<br>
</div></div>You will need to provide the scrip before we will be able to hazard any<br>
guesses.<br>
<span class="HOEnZb"><font color="#888888"> - Alex<br>
<br>
</font></span></blockquote></div><br></div>