[rt-users] sanity check on a scrip/custom flow
Kimberly McKinnis
kmckinnis at tivo.com
Wed Sep 9 17:55:39 EDT 2009
In addition, I should point out that we're running RT 3.4.5, and the following is the only logging for the transaction:
[Wed Sep 9 21:52:49 2009] [debug]: Converting 'us-ascii' to 'utf-8' for text/plain - Subjectless message (/usr/lib/rt/RT/I18N.pm:226)
[Wed Sep 9 21:52:49 2009] [debug]: Guessed encoding: ascii (/usr/lib/rt/RT/I18N.pm:396)
[Wed Sep 9 21:52:49 2009] [debug]: Guessed encoding: ascii (/usr/lib/rt/RT/I18N.pm:396)
[Wed Sep 9 21:52:49 2009] [debug]: About to think about scrips for transaction #16134 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:49 2009] [debug]: About to think about scrips for transaction #16135 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:49 2009] [debug]: About to think about scrips for transaction #16136 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:49 2009] [debug]: About to think about scrips for transaction #16137 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:49 2009] [debug]: About to think about scrips for transaction #16138 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:49 2009] [debug]: About to prepare scrips for transaction #16138 (/usr/lib/rt/RT/Transaction_Overlay.pm:160)
[Wed Sep 9 21:52:49 2009] [debug]: Found 7 scrips (/usr/lib/rt/RT/Scrips_Overlay.pm:356)
[Wed Sep 9 21:52:50 2009] [debug]: About to commit scrips for transaction #16138 (/usr/lib/rt/RT/Transaction_Overlay.pm:169)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533169-1610.579-3-0 at TiVo> #579/16138 - Scrip 3 (/usr/lib/rt/RT/Action/SendEmail.pm:237)
[Wed Sep 9 21:52:50 2009] [debug]: About to think about scrips for transaction #16139 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533169-1610.579-3-0 at TiVo> sent To: kmckinnis at tivo.com Cc: Bcc: (/usr/lib/rt/RT/Action/SendEmail.pm:297)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533169-818.579-4-0 at TiVo> #579/16138 - Scrip 4 (/usr/lib/rt/RT/Action/SendEmail.pm:237)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533169-818.579-4-0 at TiVo> No recipients found. Not sending.
(/usr/lib/rt/RT/Action/SendEmail.pm:249)
[Wed Sep 9 21:52:50 2009] [debug]: To email was: te-accounts <te-accounts at tivo.com> ((eval 2282):4)
[Wed Sep 9 21:52:50 2009] [debug]: About to think about scrips for transaction #16140 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:50 2009] [debug]: About to prepare scrips for transaction #16140 (/usr/lib/rt/RT/Transaction_Overlay.pm:160)
[Wed Sep 9 21:52:50 2009] [debug]: Found 2 scrips (/usr/lib/rt/RT/Scrips_Overlay.pm:356)
[Wed Sep 9 21:52:50 2009] [debug]: About to commit scrips for transaction #16140 (/usr/lib/rt/RT/Transaction_Overlay.pm:169)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533170-1012.579-10-0 at TiVo> #579/16140 - Scrip 10 (/usr/lib/rt/RT/Action/SendEmail.pm:237)
[Wed Sep 9 21:52:50 2009] [debug]: About to think about scrips for transaction #16141 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533170-1012.579-10-0 at TiVo> sent To: kmckinnis at tivo.com Cc: Bcc: (/usr/lib/rt/RT/Action/SendEmail.pm:297)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533170-929.579-22-0 at TiVo> #579/16138 - Scrip 22 Notify Ccs on New Ticket (/usr/lib/rt/RT/Action/SendEmail.pm:237)
[Wed Sep 9 21:52:50 2009] [debug]: About to think about scrips for transaction #16142 (/usr/lib/rt/RT/Transaction_Overlay.pm:156)
[Wed Sep 9 21:52:50 2009] [info]: <rt-3.4.5-22811-1252533170-929.579-22-0 at TiVo> sent To: Cc: te-accounts at tivo.com Bcc: (/usr/lib/rt/RT/Action/SendEmail.pm:297)
[Wed Sep 9 21:52:50 2009] [info]: Ticket 579 created in queue 'accounts' by kmckinnis (/usr/lib/rt/RT/Ticket_Overlay.pm:730)
[Wed Sep 9 21:52:51 2009] [debug]: Found a ticket ID. It's 579 (/usr/local/rt/lib/RT/Interface/Email.pm:483)
[Wed Sep 9 21:52:51 2009] [crit]: RT Recieved mail (<rt-3.4.5-22811-1252533170-929.579-22-0 at TiVo>
) from itself. (/usr/local/rt/lib/RT/Interface/Email.pm:732)
[Wed Sep 9 21:52:51 2009] [crit]: RT thinks this message may be a bounce (/usr/local/rt/lib/RT/Interface/Email.pm:736)
________________________________
From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Kimberly McKinnis
Sent: Wednesday, September 09, 2009 2:50 PM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] sanity check on a scrip/custom flow
So a little background... this used to work. Then I rebuilt the system, and all I can think is that I missed a step somewhere.
I have a queue called te-accounts. Vendors/partners email it to get an automated account set up. It's supposed to look at the domain they're emailing from, and add the user to the appropriate group. Then it is supposed to resolve the ticket, and reply to the requestor with a custom template.
What's actually happening is that it opens a ticket, immediately resolves the ticket, and responds with the generic resolved template. The user is never added to any groups.
I could use a sanity check on the moving parts to make sure I didn't miss something silly.
Queue "accounts" allows "Everyone" and "Unpriviledged" to "CreateTicket".
/etc/aliases (emails me the original request also, so I can manually intervene when it breaks)
te-accounts: accounts-queue, accounts-email
accounts-queue: "|/usr/bin/rt-mailgate --queue accounts --action correspond --url https://spdsupport.tivo.com/ --timeout 1000"
accounts-email: kmckinnis at tivo.com<mailto:kmckinnis at tivo.com>
accounts queue scrips:
Description: Adding new users to group based on domain
Condition: On Create
Action: User Defined
Template: Global Template: Autoreply
Stage: TransactionCreate
Custom condition <blank>
Custom action preparation code: return 1;
Custom action cleanup code:
# Domains we want to move
my $domains = {};
my %domain_map = (
'\@.*\.?comcast\.com' => "comcast",
'\@.*\.?cox\.com' => "cox",
'\@.*\.?tvworks\.com' => "comcast",
'\@.*\.?tivo\.com' => "support"
);
#Check each of our defined domains for a match
foreach my $domainKey (keys %domain_map ){
if($self->TicketObj->RequestorAddresses =~ /^.*?${domainKey}/) {
# Domain matches - move to the right group
my $user = RT::User->new( $RT::SystemUser );
$user->LoadByEmail($self->TicketObj->RequestorAddresses);
die "couldn't load user" unless $user->id;
my $group = RT::Group->new( $RT::SystemUser );
$group->LoadUserDefinedGroup( $domain_map{$domainKey} );
$group->AddMember($user->id);
}
}
Description: Resolve all tickets in this queue
Condition: On create
Action: User Defined
Template: Global template: group addition
Stage: TransactionCreate
Custom condition: <blank>
Custom action preparation code: return 1;
Custom action cleanup code:
$self->TicketObj->SetStatus('resolved');
return 1;
Global template for resolve account only tickets:
Subject: Resolved: {$Ticket->Subject}
Your account has been given permissions to the $group queue. Please log in via the web interface at ".$RT::WebURL." to view tickets for the $group queue.
Thank you.
{$Ticket->QueueObj->CorrespondAddress()}
-------------------------------------------------------------------------
{$Transaction->Content()}
So what the heck am I missing?
~~
Kimberly McKinnis
System Operations Engineer
Service Provider Division, TiVo Inc
408-519-9607
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090909/806c671e/attachment.htm>
More information about the rt-users
mailing list