Q: How do I send special notification to non-watchers on ticket creation ?
- How do I send notifications on ticket creation to a group other than queue Watchers?
- How do I only notify people when a new ticket is created in my queue, but not for other actions?
Context
- Request Tracker (RT) on help.mit.edu
- Request Tracker queue administrators – you have to be one to follow these instructions
Answer
RT normally uses roles ("Watchers") for notification. Sometimes you may want to send notifications to additional email addresses, but don't want to assign them a formal role. Here are two examples:
Example 1: You need the roles for something else
You have a group of people who need to be AdminCcs on a queue to get notification of everything, and you also have a folks who need to be Ccs, but you have yet a third group who only wants to be notified of new tickets, not other actions.
Example 2: You want different messages for different groups
You have your standard notification to AdminCcs, but you want a differently formated message to go to another email address for the same notification, for example new ticket creation.
Instructions
The easiest way to do this is to create a local, queue specific template for the specific notification you want to send. And include the additional or unique recipient address right in the template. The only drawback of this approach is that you need to edit the template if you want to change the recipients. For this reason, I recommend you create a Moira email list for the folks who want to receive this special notification, and use that as the recipient in your template, rather than a list of individuals.
Steps
Create a custom template
1 | Here is a copy of the global template Create Notification which is commonly used for new ticket notifications to AdminCcs:
Create Notification RT-Attach-Message: yes A new ticket has been created in the {$Ticket->QueueObj->Name} queue. Details are as follows: Ticket #: {$Ticket->id} Created: {$Transaction->CreatedAsString} Transaction: {$Transaction->Description} Queue: {$Ticket->QueueObj->Name} Subject: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"} Owner: {$Ticket->OwnerObj->Name} Requestors: {$Ticket->RequestorAddresses} Status: {$Ticket->Status} Ticket <URL: {$RT::WebAuthURL}/Ticket/Display.html?id={$Ticket->id} > {my $out = ""; $out = $Transaction->Content() unless $Transaction->Content() eq "This transaction appears to have no content"; $out; } Using this template code as a starting point, you can create a new custom template for your queue. |
---|---|
2 | After logging into Request Tracker at help.mit.edu go to Tools then Configuration and Queues Note: If you do not see the Configuration menu item, you are most likely not a queue administrator or there is a problem with your permissions. |
3 | Select your queue from the list |
4 | On your queue configuration screen go to Templates and click Create |
5 | Enter a recognizable Name for your template, for example Extended Create Notification |
6 | Enter a useful Description and include who the template will notify, for example Sends create notifications to tooltime-notify@mit.edu |
7 | Set Type to Perl |
8 | Copy the above example template text into the Content box |
9 | Edit the example template text by adding a complete new header line at the very top. Important: There must be a blank line between the last line of the header, and where the template body begins, or your template and notifications will break! Here is an example of the modified template content:
Extended Create Notification To: tooltime-notify@mit.edu RT-Attach-Message: yes A new ticket has been created in the {$Ticket->QueueObj->Name} queue. Details are as follows: Ticket #: {$Ticket->id} Created: {$Transaction->CreatedAsString} Transaction: {$Transaction->Description} Queue: {$Ticket->QueueObj->Name} Subject: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"} Owner: {$Ticket->OwnerObj->Name} Requestors: {$Ticket->RequestorAddresses} Status: {$Ticket->Status} Ticket <URL: {$RT::WebAuthURL}/Ticket/Display.html?id={$Ticket->id} > {my $out = ""; $out = $Transaction->Content() unless $Transaction->Content() eq "This transaction appears to have no content"; $out; } |
10 | Click Create to create the template for your queue |
Add a notification scrip that uses your custom template
You now need to add a scrip to your queue that actually triggers a notification using the new template.
11 | Still on the queue configuration screen, go to Scrips and select Create |
---|---|
12 | Use the following values for your new scrip:
|
13 | Click the Create button to create the new scrip |
That's it! The new template will now be used to notify on create, and since it includes a recipient line mail will be sent to those recipients.
Tips
You can use other conditions and actions in setting up your scrip. For example, if you want to send the same notification to both AdminCcs and the new notification recipient, you can set the Action on your scrip to Notify AdminCcs and Other Recipients and RT will automatically add AdminCcs as recipients as well.