[rt-users] Scrip help please.

Dougherty Paul paul_dougherty at prn.com
Wed Jun 2 17:50:56 EDT 2010


Hi,

 

I am sure this is an id10t error, but I am trying to write a scrip that
sends an adds a "CC" to a new ticket whose urgency is Critical (or
critical). So far, the closest I have gotten is to have the system add
the "CC"'s for every new ticket.

 

Here is the custom condition that is giving me the fits. The current
error I am receiving involves a syntax error...thing is, no matter what
I try, I cannot get this thing to work. Every other part of this process
works (ie, when the cc's are added, the email is sent. The custom action
does indeed add the cc's).

 

I just need to meet three conditions. One is on create, the other is
Urgency (custom field) Critical or Urgency critical.

 

Thanks,


Paul

 

 

Custom condition:

if ( ($self->TransactionObj->Type eq "Create") &&

                    ( (
$self->TicketObj->FirstCustomFieldValue('Urgency') eq "Critical") || (
$self->TicketObj->FirstCustomFieldValue('Urgency') eq "critical")))

return 1;

else 

return 0;

 

Custom action: (runs fine):

$self->TicketObj->AddWatcher( Type => "Cc", 

                              Email =>"xxx\@prn.com"); 

$self->TicketObj->AddWatcher( Type => "Cc", 

                              Email =>"xxx\@prn.com"); 

push( @{$self->{'To'}}, 

      $self->TicketObj->Requestors->MemberEmailAddresses, 

      $self->TicketObj->QueueObj->Cc->MemberEmailAddresses ); 

return 1;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100602/0ee6fe1c/attachment.htm>


More information about the rt-users mailing list