Writing custom conditions... (need a sanity check)

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.

So rather than make it a per-queue scrip, I have looked over:

http://wiki.bestpractical.com/index.cgi?WriteCustomCondition

And using the general queue as a example, would something like this
work? (basically if the queue is “General” fail, all else pass to the
template)

Re:
my $ticket = $self->TicketObj;
if ($ticket->Queue ne ‘General’) {
return(undef);
}
else {
return(1);
}

Yes, it’s a hack :slight_smile: I just want to make sure I have the correct syntax
in place.

Thanks - Peter
Peter_Losher@isc.org | ISC | OpenPGP 0xE8048D08 | “The bits must flow”

signature.asc (186 Bytes)

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.”