[rt-users] problem with custom condition in scrip
Hugo Escobar
hescobar at afslc.com
Wed May 21 22:12:03 EDT 2014
Hello,
I've been attempting to instruct rt to send emails 'On Correspond' to
'Requestors' and 'Ccs',
only if the email address of the user generating the transaction matches a
predetermined list (@domain1 or @domain2)
Following, the code I wrote for the 'custom condition':
#--- begin code ---
if ( $self->TransactionObj->Type ne 'Create'
&&
!grep { $self->CurrentUser->EmailAddress =~ /$_$/ }
('@domain1','@domain2')
) {
return 0;
}
return 1;
#-- end code --
This is the "Basics" section of the scrip:
Description: On Correspond Notify Requestors and Ccs
Condition: User Defined
Action: Notify Requestors and Ccs
Template: Correspondence
Global
Enabled
Additionally, for testing purposes I took care of setting user at domain1 as a
'requestor'
I've tested the code snippet on a regular perl script and it works 100% of
the time, however
RT is not doing what I need.
Any help will be highly appreciated
--
Hugo Escobar
[image: AFS_logo.png]
Follow us on Facebook and Linked-In
[image: facebook-24x24.png]<http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864>
[image: linkedin-24x24.png] <http://www.linkedin.com/companies/1006276>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140521/51f80ca8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: facebook-24x24.png
Type: image/png
Size: 814 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140521/51f80ca8/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AFS_logo.png
Type: image/png
Size: 3183 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140521/51f80ca8/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin-24x24.png
Type: image/png
Size: 875 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140521/51f80ca8/attachment-0002.png>
More information about the rt-users
mailing list