[rt-users] Help with approval templates

Jeremy Winder jwinder at logicalsi.com
Mon Jun 1 17:09:34 EDT 2009


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




More information about the rt-users mailing list