[rt-users] ScripConditions is not being honored / owner not sent an e-mail
slamp slamp
slackamp at gmail.com
Wed Jun 16 17:06:04 EDT 2010
On Wed, Jun 16, 2010 at 3:46 PM, slamp slamp <slackamp at gmail.com> wrote:
> On Wed, Jun 16, 2010 at 3:44 PM, slamp slamp <slackamp at gmail.com> wrote:
>> On Wed, Jun 16, 2010 at 3:31 PM, slamp slamp <slackamp at gmail.com> wrote:
>>> I have the following in my ScripConditions.
>>>
>>>
>>> mysql> select * from ScripActions where id = 20\G;
>>> *************************** 1. row ***************************
>>> id: 20
>>> Name: Notify Owners, Requestors, Ccs & Other Recipients
>>> Description: Sends mail to the Ticket Owner, Requestor and Ccs, and
>>> explicitly listed Ccs and Bccs
>>> ExecModule: Notify
>>> Argument: Owner,Requestor,Cc,OtherRecipients
>>> Creator: 1
>>> Created: 2009-05-14 09:52:07
>>> LastUpdatedBy: 1
>>> LastUpdated: 2009-05-14 09:52:07
>>> 1 row in set (0.00 sec)
>>>
>>> --------------------------------------
>>> GROUP members:
>>> bert
>>> ernie
>>>
>>>
>>> ---------------------------------------
>>> Scrip:
>>>
>>> Condition: On Correspond
>>> Action: Notify Owners, Requestors, Ccs & Other Recipients
>>> Template: Notify-GROUP
>>> Stage: TransactionCreate
>>>
>>> ---------------------------------------
>>> Notify-GROUP template:
>>>
>>> Bcc: {
>>> my $GroupName = 'GROUP';
>>>
>>> # instantiate a group object
>>> my $addGroupObj = RT::Group->new($RT::SystemUser);
>>> $addGroupObj->LoadUserDefinedGroup($GroupName);
>>> return undef unless $addGroupObj;
>>> my $addGroupMembersObj = $addGroupObj->UserMembersObj;
>>>
>>> my $CorresponderEmailAddress = $Transaction->CreatorObj->EmailAddress;
>>> my $RequestorEmailAddress = $Ticket->RequestorAddresses;
>>>
>>> my $res = '';
>>> # walk through members of group
>>> while ( my $userObj = $addGroupMembersObj->Next) {
>>> my $email = $userObj->EmailAddress;
>>> next unless $email; # email can be empty
>>> if (( "$email" ne "$CorresponderEmailAddress" ) && ( "$email" ne
>>> "$RequestorEmailAddress" )) {
>>> $res .= ', ' if $res;
>>> $res .= $email;
>>> }
>>> }
>>> $res;
>>> }
>>> RT-Attach-Message: yes
>>>
>>> {$Transaction->Content()}
>>>
>>> ------------------------------------------
>>> Ticket info:
>>>
>>> Owner: grover
>>> Requestors: bert
>>> Cc: oscar
>>>
>>>
>>> -----------------------------------------
>>> Hit Reply on the web interface and grover is not listed "This message
>>> will be sent to..."
>>>
>>> I see only:
>>>
>>> To: bert
>>> Cc: oscar
>>> Bcc: ernie
>>>
>>>
>>>
>>>
>>> Am I missing anything or is RT not recognizing my ScripConditions?
>>>
>>
>> If I flip the Action to Notify Owner and hit reply, I see grover
>> (owner) for the To field and ernie (GROUP member) for the Bcc field
>> which works as expected.
>>
>
> Forgot to mention I am running version 3.8.7 on CentOS 4.8.
>
i think i got it. the template was taking over Bcc so i modified it to
include the owner. it works for me so here it is for anyone searching
the list.
Bcc: {
my $GroupName = 'GROUP';
# instantiate a group object
my $addGroupObj = RT::Group->new($RT::SystemUser);
$addGroupObj->LoadUserDefinedGroup($GroupName);
return undef unless $addGroupObj;
my $addGroupMembersObj = $addGroupObj->UserMembersObj;
my $CorresponderEmailAddress = $Transaction->CreatorObj->EmailAddress;
my $RequestorEmailAddress = $Ticket->RequestorAddresses;
my $OwnerEmailAddress = $Ticket->OwnerObj->EmailAddress;
my $res = "$OwnerEmailAddress";
# walk through members of group
while ( my $userObj = $addGroupMembersObj->Next) {
my $email = $userObj->EmailAddress;
next unless $email; # email can be empty
if (( "$email" ne "$CorresponderEmailAddress" ) && ( "$email" ne
"$RequestorEmailAddress" )) {
$res .= ', ' if $res;
$res .= $email;
}
}
$res;
}
RT-Attach-Message: yes
{$Transaction->Content()}
More information about the rt-users
mailing list