Difference between revisions of "Silent Resolve (MuteResolve ReRedux)"

From Request Tracker Wiki
Jump to navigation Jump to search
(Created page with "Okay, this wiki is by far the worst wiki software I've ever seen. I can't for the life of me figure out how to get this article to format, so I'm leaving it as-is. Just edit this...")
 
m (3 revisions imported)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Okay, this wiki is by far the worst wiki software I've ever seen. I can't for the life of me figure out how to get this article to format, so I'm leaving it as-is. Just edit this page, click the source button on the right of the terrible WYSIWYG editor and copy and paste that into a text editor on your local box. Then read the article. Sorry 'bout the trouble, but I wanted to post this because I think it's a really good solution. Why do they make it so hard to contribute.
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.


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.
#Create a Ticket Custom Field called Silent Resolve. ('''Tools->Configuration->Custom Fields->Create''') Name: SilentResolve<br />Type: Select one value<br />Render Type: List (you may have to save it before this option appears)<br />Values: Sort=0, Name='Yes'
 
#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)
1) Create a Ticket Custom Field called Silent Resolve. (Tools->Configuration->Custom Fields->Create)
#Create a new Global Template (Your mail server should route nobody@ to /dev/null)<br />Name: Resolved (Check Silent)<br />Type: Perl<br />Content:<br />
Name: SilentResolve
  <nowiki>
Type: Select one value
    {  
Render Type: List (you may have to save it before this option appears)
    $nobody = 'nobody@localhost';
Values: Sort=0, Name='Yes'
    if ($Ticket->FirstCustomFieldValue('SilentResolve') eq 'Yes') {
 
    "To: $nobody\nCc: $nobody\nBcc: $nobody\n";
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)
    } else {
 
    ;
3) Create a new Global Template (Your mail server should route nobody@ to /dev/null)
    }
Name: Resolved (Check Silent)
    }Subject: Resolved: {$Ticket->Subject}  
 
   
 
    According to our records, your request has been resolved. If you have any
Type: Perl
    further questions or concerns, please respond to this message.
 
    </nowiki>
 
: 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.
 
#Set the "On Resolve Notify Requestors" scrip to use this template.
 
#Create a new scrip. ('''Tools->Configuration->Global->Scrips->Select''')<br />Name: Unset Silent Resolve<br />Condition: On Reopen<br />Action: User Defined<br />Template: Global template: Blank<br />Stage: TransactionCreate<br />Custom Condition:<br />
Content:
<nowiki> return ($self->TicketObj->FirstCustomFieldValue('SilentResolve') eq 'Yes' ? 1 : 0);
 
  </nowiki>
 
<br />Custom action preparation code:<br />
  <code>{
  <nowiki>
$nobody = 'nobody@localhost';
  $self->TicketObj->DeleteCustomFieldValue( Field => 'SilentResolve', Value => 'Yes');
if ($Ticket->FirstCustomFieldValue('SilentResolve') eq 'Yes') {
  $RT::Logger->info("Silent Resolve unset on Reopen of ticket ".$self->TicketObj->id);
"To: $nobody\nCc: $nobody\nBcc: $nobody\n";
  return 1;
} else {
  </nowiki>
'';''
}
}Subject: Resolved: {$Ticket->Subject}</code>
According to our records, your request has been resolved. If you have any
further questions or concerns, please respond to this message.
</code>
 
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.
4) Set the "On Resolve Notify Requestors" scrip (Tools->Configuration->Global->Scrips->Select) to use this template.
5) 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 preperation code:
  $self->TicketObj->DeleteCustomFieldValue( Field => 'SilentResolve', Value => 'Yes');
$RT::Logger->info("Silent Resolve unset on Reopen of ticket ".$self->TicketObj->id);
return 1;
# End Custom action preperation code

Latest revision as of 16:37, 6 April 2016

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;