Greetings RT Forum & Happy June for those that begin the summer months like us northerners!
I’m attempting to make a Scrip with conditional logic if a ticket is “Untaken”, but it would seem there is no transaction type for Untake, as this does not evaluate true on Untake action:
So you want to detect if the user changed to ‘nobody’ because “Untake” is the same as setting to ‘nobody’. Right?
Got two solutions in my mind:
Use logging to write the TransactionObj->Field or TransactionObj->Type to the logfile. I dont know the value for OwnerChange, too. See example below how to use logging. Then use $self->TransactionObj->OldValue !~ /nobody/i;and $self->TransactionObj->NewValue =~ /nobody/i; to test for “untake”.
Second is to use ‘On Owner Change’ and test for Owner “Nobody”. So if “Owner Change” is true there must be an other owner than ‘nobody’ before.
Thank you! This pointed me in the right direction.
I was looking for way to resolve a bug in the “RT-Action-AssignUnownedToActor” plugin which is triggered by attempting to Untake a ticket where you’re the owner (and not the requester). If you try this the plugin assigns you back to the owner after you Untake the ticket so it makes a kinda loop.
This diff of “AssignUnownedToActor.pm” contains the resolution I have tested & confirmed to work:
14a15,18
> # where the action is not already an owner change
> # Specifically, this is to corect a bug where this extension breaks "Untake" functionality
> return 0 if $self->TransactionObj->Type eq "Set" && $self->TransactionObj->Field eq "Owner";
>
Once the above line is added, you also need to move the scrip (with action “Assign unowned tickets to actor”) to be a batch scrip, otherwise it won’t work.