Silent Resolve (MuteResolve ReRedux)

From Request Tracker Wiki
Revision as of 16:37, 6 April 2016 by Admin (talk | contribs) (3 revisions imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I couldn't get either the MuteResolve or MuteResolve Redux solutions to work, so here's mine. It seems to work well and is simpler. Tested with RT 4.0.2, but sould probably work with 3.x versions as well.

  1. Create a Ticket Custom Field called Silent Resolve. (Tools->Configuration->Custom Fields->Create) Name: SilentResolve
    Type: Select one value
    Render Type: List (you may have to save it before this option appears)
    Values: Sort=0, Name='Yes'
  2. Select it under Tools->Configuration->Global->Custom Fields->Tickets. (Why the two-step process beats me, especially when they have an Enabled checkbox on the field definition in step 1)
  3. Create a new Global Template (Your mail server should route nobody@ to /dev/null)
    Name: Resolved (Check Silent)
    Type: Perl
    Content:
     { 
     $nobody = 'nobody@localhost';
     if ($Ticket->FirstCustomFieldValue('SilentResolve') eq 'Yes') {
     "To: $nobody\nCc: $nobody\nBcc: $nobody\n";
     } else {
     ;
     }
     }Subject: Resolved: {$Ticket->Subject} 
    
     According to our records, your request has been resolved. If you have any
     further questions or concerns, please respond to this message.
     
Note that the "}Subject" is not a typo. You need it like that to make sure all that stuff is part of the e-mail header.
  1. Set the "On Resolve Notify Requestors" scrip to use this template.
  2. Create a new scrip. (Tools->Configuration->Global->Scrips->Select)
    Name: Unset Silent Resolve
    Condition: On Reopen
    Action: User Defined
    Template: Global template: Blank
    Stage: TransactionCreate
    Custom Condition:
 return ($self->TicketObj->FirstCustomFieldValue('SilentResolve') eq 'Yes' ? 1 : 0);
 


Custom action preparation code:

  $self->TicketObj->DeleteCustomFieldValue( Field => 'SilentResolve', Value => 'Yes');
  $RT::Logger->info("Silent Resolve unset on Reopen of ticket ".$self->TicketObj->id);
  return 1;