Condition for non resolved only

Thanks to everyone for all the help:
I have been working on this the whole week and have finally got
something that works. I thought I would share it with you since I see
there are other people that are looking for the same code. If someone
can point out any obvious mistakes, please do.

To prevent any replies to resolved tickets and sending of emails on
already resolved tickets I changed all the “On Correspond” events to
rather use this user defined code:


if( $self->TransactionObj->Type eq ‘Correspond’ &&
($self->TicketObj->Status eq ‘open’ || $self->TicketObj->Status eq
’external’ || $self->TicketObj->Status eq ‘new’) ) {
return 1; }
{ return undef; }

Another condition that we use, is to only automatically “open” tickets
that are marked as “external”

if( $self->TransactionObj->Type eq ‘Correspond’ &&
$self->TicketObj->Status eq ‘external’ ) {
return 1;
} else {
return undef;

(BTW, external is a custom status that we use, while we are waiting for
external feedback)

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.