Need to send "Big Cheese" email based on requestor's email or group membership

Hello,

We are running RT 4.0.7 in production and a test instance of 4.0.18. We have the need to flag
tickets from VIPs by comparing the incoming (on create) ticket’s requestor’s email address
OR if they are member of a particular Windows AD group. If a match is found, then
send an email to a specific email address (our group) with Subject: Big Cheese ticket
and a short body with the requestors name and email …let’s say. Maybe action of Notify AdminCC’s
would be fine in this case.

I found this snippet of code in the RT wiki:
http://requesttracker.wikia.com/wiki/CustomConditionSnippets

return 0 unless $self->TransactionObj->Type eq “Create”;
return 1 if $self->TicketObj->IsWatcher(
Type => ‘Requestor’, Email => ‘bigcheese@harvard.edu’
);
return 0;

Which works but only checks against 1 email address. We have 50-60 people in the big cheese group.
I have written a small perl script which dumps out all the email address for all the big cheese’s in
a file in /tmp, 1 email per line. Any way to check against that inside RT on create ? Or check if a requestor is in
a specific Windows AD group ? If yes, trigger the email to our group.

Thanks in advance for any help,
Mike

Hi,

for this type of requests we create an group inside RT, add all email
adresses (RT User) to this Group, add all User that should be notified
as AdminCc to the queue and then create a scrip (replace xxx with the
"Big Cheese" group id):

Condition: User Defined
Action: Notify AdminCcs
Template: you custom email template
Stage: TransactionCreate
Custom condition:

return 0 unless $self->TransactionObj->Type eq ‘Create’;
my $CreatorObj = $self->TransactionObj->CreatorObj;
my $GroupObj = RT::Group->new(RT->SystemUser);
$GroupObj->Load(xxx); # Big Cheese Group Id
return 1 if $GroupObj->HasMember($CreatorObj->PrincipalId);
return 0;

Chris

Hi Chris,

Thanks for the reply back. So there is no way to do the check dynamically in case the members of the
Big Cheese" group change randomly…via grep’ing a file with all the email addresses in it, or quering a Window AD
group on the fly ? We would have to maintain the group in RT manually as members change ?

Thanks,
Mike-----Original Message-----
From: Christian Loos [mailto:cloos@netcologne.de]
Sent: Friday, January 17, 2014 2:48 AM
To: Ethier, Michael
Cc: rt-users@lists.bestpractical.com
Subject: Re: Need to send “Big Cheese” email based on requestor’s email or group membership

Hi,

for this type of requests we create an group inside RT, add all email adresses (RT User) to this Group, add all User that should be notified as AdminCc to the queue and then create a scrip (replace xxx with the “Big Cheese” group id):

Condition: User Defined
Action: Notify AdminCcs
Template: you custom email template
Stage: TransactionCreate
Custom condition:

return 0 unless $self->TransactionObj->Type eq ‘Create’; my $CreatorObj = $self->TransactionObj->CreatorObj;
my $GroupObj = RT::Group->new(RT->SystemUser); $GroupObj->Load(xxx); # Big Cheese Group Id return 1 if $GroupObj->HasMember($CreatorObj->PrincipalId);
return 0;

Chris

Hi Chris,

Thanks for the reply back. So there is no way to do the check dynamically in case the members of the
Big Cheese" group change randomly…via grep’ing a file with all the email addresses in it, or quering a Window AD
group on the fly ? We would have to maintain the group in RT manually as members change ?

Thanks,
Mike

I just want to show you the way we have done things like this.

Within RT scrips you can do with Perl what ever you want.

Chris