[rt-users] RT 4.2 and ownership of tickets after comments

Chris Hall hiro24 at gmail.com
Tue Nov 5 15:36:55 EST 2013


Still haven't found anything.  What's odd is that it's not a problem w/ the
scrip.  The scrip still works.  RT force changes the owner to whoever made
the comment.  It even shows up in the history.  But it's like the very next
thing that happens is the new owner "gives" the ownership back to the
original owner.  I can't seem to figure out why.


On Tue, Nov 5, 2013 at 12:32 PM, Chris Hall <hiro24 at gmail.com> wrote:

> 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 <hiro24 at 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 <alexmv at 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
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20131105/60785f91/attachment.htm>


More information about the rt-users mailing list