[rt-users] Result after On queue change

Kevin Falcone falcone at bestpractical.com
Mon Aug 13 10:37:21 EDT 2012


On Mon, Aug 13, 2012 at 01:54:33PM +0200, Björn Schulz wrote:
> I try to build a scrip to avoid a queue change from a specific queue
> (general (1)) if a Cf (Text1) isn't set on a rt3.8 box.
> 
> In principal it work as a global scrip, but the result field didn't say
> the truth. ;-)
> 
> After the not possible queue change the ticket is in the old queue, but
> results tells me:
> 
>     Ticket 30: Queue changed from General to TQ-1
> 
> Any ideas to fix this?

Unfortunately, the Scrip runs after the queue has been changed (it's
triggered by the transaction of the change), and Scrips can't hand data
back to the Messages in the UI.

You'll need to do this with a callback, probably BeforeUpdate in
Update.html.  That callback lets you set a $skip_update boolean as
well as push a message onto @results.  It will also prevent the queue
change, so it won't be a change and a change back.

-kevin


> 
> P.S. Here is my global scrip. On queue level (general) it doesn't work
> for me.
> 
> 
> Description:	Queue Change only if Text1 is set
> Condition:	On Queue Change
> Action:		User Defined
> Template:	Global template Blank
> Stage:		TransactionCreate
> 
> 
> -------------------------------------------------------
> Custom action preparation code:	
> 
> return 1;
> -------------------------------------------------------
> Custom action cleanup code:	
> 
> my $OV =  			
> $self->TransactionObj->OldValue;
> $RT::Logger->crit("The old value is: ".$OV);
> if ($OV != 1)
> {
>      return 0;
> }
> if (!$self->TicketObj->FirstCustomFieldValue("Text1"))
> {
>       $self->TicketObj->SetQueue($OV);
> }
> return 1;
> -------------------------------------------------------
> 
> In pricipal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120813/d41256fa/attachment.sig>


More information about the rt-users mailing list