[rt-users] Writing custom conditions... (need a sanity check)

Russell Mosemann mose at ns.cune.edu
Tue Mar 15 07:28:59 EST 2005


On Tue, 15 Mar 2005, Peter Losher wrote:

> There is a global on create scrip that we are using in a RT3 install
> (3.0.11) and we now have a case where we need to exempt a queue (just
> one queue) from that scrip action.
...
> my $ticket = $self->TicketObj;
> if ($ticket->Queue ne 'General')  {
>     return(undef);
> }
> else {
>     return(1);
> }

That is incorrect.  One way to write the custom condition is

return($self->TransactionObj->Type eq "Create" &&
       $self->TicketObj->QueueObj->Name ne "General");

----
Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska
Two atoms walking down the street ran into each other.  "Are you alright?"
"I think I lost an electron."  "Are you sure?"  "Yes, I'm positive."




More information about the rt-users mailing list