[rt-users] Help with approval templates

Jeremy Winder jwinder at logicalsi.com
Tue Jun 2 11:33:40 EDT 2009


Two steps forward, one step back. Ok, I have my initial problem of the
approvers not receiving the 'New Pending Approval' email from the
template in the ___Approvals queue resolved. I fixed it with change to
the code:

--- rt-3.8.3/lib/RT/Approval/Rule/NewPending.pm.orig	2009-05-27
11:50:50.000000000 -0400
+++ rt-3.8.3/lib/RT/Approval/Rule/NewPending.pm	2009-06-02
11:17:21.000000000 -0400
@@ -76,6 +76,7 @@
     # first txn entry of the approval ticket
     local $self->{TransactionObj} = $to;
     $self->RunScripAction('Notify Owner', 'New Pending Approval', @_);
+    $self->RunScripAction('Notify AdminCcs', 'New Pending Approval',
@_);
 
     return;

Since the template says "Notify Owners and AdminCcs of new items pending
their approval" that this is a bug that was over looked. However, I
still have the second problem, which I understand better now.
 
Anytime an approval ticket is created using the scrip and template in my
General queue, the approvers get two emails. One of which is the 'New
Pending Approval' email from the default template in the ___Approvals
queue, and the other is the 'Global: On Create Notify AdminCcs with
template Transaction' script. I would rather not delete a scrip
installed as part of RT. It could make things confusing down the road as
our implementation evolves. However, our approvers are complaining about
getting both emails, and see as they are the bosses, they get what they
want. Is there another way around this issue or is simply removing that
global scrip my best path?

Thanks,

Jeremy


On Mon, 2009-06-01 at 18:16 -0400, Jeremy Winder wrote:
> Ok, I removed the AdminCC and put the Owner: back in the template for
> the General queue, just to ensure I wasn't loosing my mind. I get both
> "needs approval" notifications, which I didn't realize before.
> 
> So what I want to happen is this, I want to be able to have multiple
> users with the ability to approve tickets; but I only want the ticket to
> require one of them. And I want the better looking default notification
> emails.
> 
> Any help will be greatly appreciated. I'm trying to learn the system and
> go live at the same time, which isn't a good combination.
> 
> Thanks in advance,
> 
> Jeremy
> 
> On Mon, 2009-06-01 at 17:09 -0400, Jeremy Winder wrote:
> > I have been fighting this all day, I'm sure it is something simple but
> > I'm completely missing it.
> > 
> > I had approvals setup with one person being the approver using the
> > following scrip and template on my General queue:
> > <scrip>
> > Description: Create Approval
> > Condition: On Create
> > Action: Create Tickets
> > Template: Approvals
> > Stage: TransactionCreate
> > </scrip>
> > <template>
> > Name: Approvals
> > Description: Template used for requesting approvals
> > Content:
> > ===Create-Ticket: Approval
> > Subject: Approval for {$Tickets{'TOP'}->Subject}
> > Depended-On-By: TOP
> > Queue: ___Approvals
> > Type: approval
> > Owner: <name-of-user>
> > Content: Someone has created a ticket. you should review and approve
> > it, so work can begin.
> > ENDOFCONTENT 
> > </template>
> > 
> > And all was well. I was receiving these emails as the "needs to be
> > approved" notices:
> > 
> >         Greetings,
> >         
> >         There is a new item pending your approval: "CR Approval for: 9 -
> >         This is a test ticket 5", 
> >         a summary of which appears below.
> >         
> >         Please visit http://localhost/rt/Approvals/Display.html?id=10
> >         to approve or reject this ticket, or
> >         http://localhost/rt/Approvals/ to
> >         batch-process all your pending approvals.
> >         
> >         -------------------------------------------------------------------------
> >         Someone has created a ticket. you should review and approve it,
> >         so they can finish their work
> > 
> > But then the fun began. I needed to it up so multiple people can approve
> > a ticket but only one of them has to. So I followed the instructions at
> > the bottom on http://wiki.bestpractical.com/view/ApprovalCreation and
> > changed my General queue's template to be:
> > <template>
> > Name: Approvals
> > Description: Template used for requesting approvals
> > Content:
> > ===Create-Ticket: Approval
> > Subject: Approval for {$Tickets{'TOP'}->Subject}
> > Depended-On-By: TOP
> > Queue: ___Approvals
> > Type: approval
> > AdminCC: {
> >    my $group_name  = 'Group Name';
> >    my $groups      = RT::Groups->new( $RT::SystemUser );
> > 
> >    $groups->LimitToUserDefinedGroups();
> >    $groups->Limit(
> >          'FIELD'    => 'Name',
> >          'OPERATOR' => '=',
> >          'VALUE'    => $group_name );
> >    $groups->First->Id;
> > }
> > Content: Someone has created a ticket. you should review and approve
> > it, so work can begin.
> > ENDOFCONTENT
> > </template>
> > 
> > Now I get the emails that looks like this:
> >         Mon Jun 01 16:51:24 2009: Request 35 was acted upon.
> >          Transaction: Ticket created by RT_System
> >                Queue: ___Approvals
> >              Subject: Approval for Testing Approvials again
> >                Owner: Nobody
> >           Requestors: 
> >               Status: new
> >          Ticket <URL:
> >         http://rt.logicalsi.com/rt/Ticket/Display.html?id=35 >
> >         
> >         
> >         Someone has created a ticket. you should review and approve
> >         it, so work can begin.
> > 
> > I realize the "new" emails I'm getting are from my template in the
> > General queue and I could just copy the template from the ___Approvals
> > queue over and add the AdminCC part. But I'm curious as to why adding
> > the AdminCC part to my template completely changed the systems
> > operation.
> > 
> > Thanks,
> > 
> > Jeremy
> > 
> > _______________________________________________
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> > 
> > Community help: http://wiki.bestpractical.com
> > Commercial support: sales at bestpractical.com
> > 
> > 
> > Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> > Buy a copy at http://rtbook.bestpractical.com
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com




More information about the rt-users mailing list