[rt-users] Scrip with multiple custom fields checked.

Ben Robson benr at tlcdatasecurity.com.au
Mon Apr 6 22:59:50 EDT 2009


Hello list,

I have a scrip that checks to see if the value of several custom fields change.  The intention is that if any one of the custom fields change it should execute the scrip action (in this case to send an email).

The problem I have is that the scip is executing once per identified change.  i.e.  if one of the custom fields change it calls the action once, but if three of the custom fields change it calls the action three times.  I only want to call the action once regardless of how many custom fields change (i.e. if 1+ custom fields change, execute action once).

Any ideas on how to stop the action being called multiple times would be greatly appreciated.

This is my scrip:

Descripion:  FooBar
Condition: User Defined
Action: Send Email
Template : FooBar Template
Stage: Transaction Create

Custom condition:
my $Transaction = $self->TransactionObj;
return 0 unless ( $Transaction->Type eq 'CustomField'
                  && ( $Transaction->Field     eq   '35' ||
                       $Transaction->Field     eq   '36' ||
                       $Transaction->Field     eq   '37' ||
                       $Transaction->Field     eq   '38' )
                );
return 1;

There is nothing in the custom action fields.

Thanks for the help.

BenR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090407/b27349c9/attachment.htm>


More information about the rt-users mailing list