MuteResolve

From Request Tracker Wiki
Jump to: navigation, search

Contributed by Cris

Overview

By default RT has a scrip to notify requestors when a ticket is resolved. This is generally a good idea; however, sometimes you may want to avoid notifying requestors. One example is when someone reopens a ticket just because he answered "Thanks" to your resolution notification.

How to set up MuteResolve in RT4:


1. Custom field creation

First create a new custom field: Configuration -> Custom Fields -> Create

Name: MuteResolve

Description: If Yes, don't send email notifications on resolve

Type: Select one value (but I prefer Combobox because it looks better)

Applies to: Tickets

Validation: (?#YesNo)^(Yes|No|\z)$ (only necessary for Combobox)

When you click on "Save Changes" RT will let you enter Values.

Enter one value: "Yes". You need only fill the Name field, I have left Sort and Description empty. Then "Save Changes" again.

On the "Applies To" page select the queues where you want to enable the custom field, then on the "Group Rights" give the "ModifyCustomField" right to the "Privileged" system group.


2. Editing Scrip

Go to Configuration -> Global -> Scrips, then click on "On Resolve Notify Requestors"

Change "Condition" from "On Resolve" to "User Defined".

Change "Stage" from "TransactionCreate" to "TransactionBatch".

In the "Custom condition" box enter this code:

 1 my $trans = $self->TransactionObj;
 2 my $ticket = $self->TicketObj;
 3 
 4 # is this a resolve?
 5 return 0 unless ($trans->Type eq "Status" && $trans->NewValue eq "resolved");
 6 
 7 my $val = $ticket->FirstCustomFieldValue('MuteResolve');
 8 if ($val eq 'Yes') {
 9     $RT::Logger->debug("MuteResolve (Requestor): Yes.");
10     return 0;
11 }
12 
13 return 1;