3 Some types of change requests processed through RT can
4 require an approval before being fulfilled. You can configure
5 RT to set up such an approval workflow for tickets in
8 This document walks through the steps to set up a
9 "Change requests" queue with approvals. You should try
10 this in a test instance first. If you don't have a test RT
11 instance, you should read through the entire document first,
12 change the details as needed for your approval scenario, and then
17 The approvals solution in RT involves using a special queue,
18 called ___Approvals, to hold approval requests. Scrips and
19 templates automatically create the necessary tickets
20 and process the approval or rejection.
22 =head2 Change Management Queue
24 Since this example will use a change management queue as the
25 queue where tickets need approval, first we'll set up the queue.
27 Login into UI as the 'root' user. Go to Admin -> Queues and create a new
28 'Change requests' queue.
30 When you set up this queue, do not select the "approvals" Lifecycle.
31 That selection is for the ___Approvals queue itself, not for queues that
32 need tickets approved.
34 =head3 Change Management Template
36 Once the Change Management queue is created, select Templates
37 -> Create in the queue configuration menu. Enter the Name 'create approval',
38 leave the default Type as Perl and in the content area enter the following:
40 ===Create-Ticket: Manager approval
41 Subject: Manager Approval for {$Tickets{TOP}->Id} - {$Tickets{TOP}->Subject}
45 Requestors: {$Tickets{TOP}->RequestorAddresses}
47 Content-Type: text/plain
48 Due: {time + 3*24*60*60}
49 Content: Please approve me.
54 All of the text should be against the left side of the textarea
59 You'll now use this template when you create the scrip.
61 =head3 Change Management Scrip
63 Now you need a scrip. On the queue configuration page, select
64 Scrips -> Create. For the Description, enter 'Create an approval
65 on ticket create', select the 'On Create' condition, 'Create Tickets'
66 action, and select the template you just created. Click create.
70 You can already test your first workflow with approvals. Create
71 a ticket in your new 'Change requests' queue. You're logged in as
72 'root' and the owner of the approval is root (based on the template),
73 so it's your job to approve or deny the request. Select Tools -> Approvals
74 in the RT main menu. You should see your first approval request.
76 Select the 'Deny' radio button, write 'too expensive' in the notes area
77 and click Go! You just rejected the approval request. If you open the ticket
78 you created for testing then you will see that it's rejected
79 as well and has the correspondence:
83 Your ticket has been rejected by root.
85 Approver's notes: too expensive
87 You may need to search for the ticket since the rejected state means
88 it's no longer 'active'.
90 Where did this message come from? From templates in the ___Approvals
93 =head2 ___Approvals queue
95 ___Approvals is a special queue where all approvals are created. The queue
96 is disabled and is not shown in until you search for it.
97 Go to Admin -> Queues, leave "Name is" in the search
98 area and enter ___Approvals into the search
99 field. Check 'Include disabled queues in listing.' and click Go!
100 You should now see the ___Approvals queue configuration page.
102 You may want to change the name of the ___Approvals queue, but parts of RT
103 expect it not to change. The name normally isn't shown to users, however, so
104 it will be largely invisible.
106 =head2 Approvals' templates
108 From the ___Approvals queue configuration page, click 'Templates' in the
109 page menu. You should see templates that are used after actions
110 on approvals. For example if you click on the 'Approval Rejected'
111 template in the list, you will see the template that generates
112 the correspondence mentioned above.
116 =item * New Pending Approval
118 Owners of new approval requests get this message.
120 =item * Approval Passed
122 Recorded as correspondence on the ticket when it's approved by an
123 approver, but still requires more people to approve.
125 =item * All Approvals Passed
127 Recorded when no more approvals are required.
129 =item * Approval Rejected
131 Recorded when the approval request is rejected (denied).
133 =item * Approval Ready for Owner
135 Sent to the Owner of the ticket when it's approved and no more approvals
140 You can customize these templates to meet your needs. However,
141 note that there is just one ___Approvals queue for the system,
142 so make sure changes work with all queues that use approvals.
146 Navigate back to the template used to create approvals. It has
151 With this code you set the owner of the approval request to root.
152 Approvals, as well as tickets, have Ccs, AdminCcs and Requestors. For
153 example the following line copies requestors from the Tickets
154 to the approval request:
156 Requestors: {$Tickets{TOP}->RequestorAddresses}
158 Let's create a group 'Change Approvers' and let any user of
159 this group approve 'Change Requests'. Create the group, and add root
160 as a member. Open the 'create an approval' template, and replace
161 the 'Owner:...' line with the following:
163 AdminCcGroup: Change Approvers
165 Note that this line only works in RT 4.0.5 and newer.
167 Create another test ticket, and you as root still should be able to see
168 the newly created approval, but now because of the group membership.
169 You can accept or deny it.
171 Any member of the group can accept/deny without consulting
172 the other members, which is useful with more complex
175 =head2 Approvers' Rights
177 Since the ___Approvals queue is a regular RT queue, you need
178 to grant rights to allow your approvers to operate on approval
179 requests. As root, you have super user rights and haven't needed
180 specific rights for this example.
182 It's wise to grant rights via roles as there
183 is only one queue for all approvals in the system.
185 To grant rights to your Change Approvers group, go to the queue
186 configuration page for the ___Approvals queue. Click on Group Rights
187 in the page menu. Grant ShowTicket and ModifyTicket rights to the
188 Owner and AdminCc roles. This should be enough for most cases.
190 Now members of the 'Change Approvers' group can act on approvals
191 even if they have no SuperUser rights.