Difference between revisions of "MuteResolve"

From Request Tracker Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by one other user not shown)
Line 2: Line 2:


=== Overview ===
=== 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.
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.


I haven't found a solution satisfying me, so I developed my own. It involves a transaction custom field, called MuteResolve, that privileged users can set when they resolve a ticket. If set to "Yes", RT won't send any email.
=== How to set up MuteResolve in RT4: ===
 
'''Note''' that, being a transaction custom field, you'll see it in any transaction, not only on resolve (e.g. you'll see it on the ticket "comment" page too), but it only makes sense on resolve.
 
This is implemented on RT 3.8.4.
 
2010-08-23 Updated for 3.8.8 (change in validation).
 
=== How to set up MuteResolve in RT3: ===


----
----
Line 29: Line 19:
'''Type:''' <code>Select one value</code> (but I prefer Combobox because it looks better)
'''Type:''' <code>Select one value</code> (but I prefer Combobox because it looks better)


'''Applies to:''' Ticket Transactions
'''Applies to:''' Tickets


'''Validation:''' (?#YesNo)^(Yes|No|\z)$ (only necessary for Combobox)
'''Validation:''' <code>(?#YesNo)^(Yes|No|\z)$</code> (only necessary for Combobox)


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

Latest revision as of 02:59, 25 July 2018

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:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

 # is this a resolve?
return 0 unless ($trans->Type eq "Status" && $trans->NewValue eq "resolved");

my $val = $ticket->FirstCustomFieldValue('MuteResolve');
if ($val eq 'Yes') {
    $RT::Logger->debug("MuteResolve (Requestor): Yes.");
    return 0;
}

return 1;