This is my way: my @QueueList = qw(Q1 Q2); my $qname = $self->TicketObj->QueueObj->Name; return 0 if grep /$qname/, @QueueList; return 1;
Chris Am 16.06.2010 18:28, schrieb slamp slamp: > On Tue, Jun 15, 2010 at 5:31 PM, slamp slamp <[email protected]> wrote: >> On Tue, Jun 15, 2010 at 5:28 PM, slamp slamp <[email protected]> wrote: >>> I have a global scrip >>> >>> Condition: User defined >>> Action: Notify All >>> >>> I have this in my custom condition: >>> >>> return (($self->TransactionObj->Type eq "Correspond") && >>> ($self->TicketObj->QueueObj->Name ne "Q1")); >>> return (($self->TransactionObj->Type eq "Correspond") && >>> ($self->TicketObj->QueueObj->Name ne "Q2")); >>> return (($self->TransactionObj->Type eq "Correspond") && >>> ($self->TicketObj->QueueObj->Name ne "Q3")); >>> >>> Scrip is not executed when the queue is Q1, however it is executed >>> when the queue is either Q2 or Q3. I think I need to somehow combine >>> the logic but i am not much of a perl guy. >>> >>> Any help is appreciated. >>> >> >> Would something like this work? >> >> return (($self->TransactionObj->Type eq "Correspond") && >> (($self->TicketObj->QueueObj->Name ne "Q1") || >> ($self->TicketObj->QueueObj->Name ne "Q2") || >> ($self->TicketObj->QueueObj->Name ne "Q3"))); >> > > for the other non-perl people like me, the following works. > > return (($self->TransactionObj->Type eq "Correspond") && > (($self->TicketObj->QueueObj->Name ne "Q1") && > ($self->TicketObj->QueueObj->Name ne "Q2") && > ($self->TicketObj->QueueObj->Name ne "Q3"))); > > Discover RT's hidden secrets with RT Essentials from O'Reilly Media. > Buy a copy at http://rtbook.bestpractical.com > Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
