[rt-users] Modify scrip on resolving ticket

Andy Harrison aharrison at gmail.com
Tue Dec 28 09:01:40 EST 2004


On Mon, 27 Dec 2004 12:31:21 +0100, Sivan DERAY
<sivan.deray at net-aptitude.fr> wrote:
>  
> Hi everybody, 
>   
> I'm using RT 3.0.10 
>   
> I'd like to include in the "Ticket Resolved model" the content of the
> comment sent to the admin groupe when resolving a ticket. 
>   
> Instead of sending a generic resolved message to the client and an another
> to the admin group, i'd like to send one including the content of the
> resolved ticket (sent to the admin group) to the client and an another
> including the link to the admin group as it is already preconfigured. 
>   
> can somebody help me ?

Use two scrips.  You're asking for something that would take a great
deal of time for something that can already be done in a few minutes
by just having two different scrips using two different templates.

To include resolve comments, here is an example template that does just that.

>>>>>----  Cut Here (make sure there's no blank line at the very top) ----<<<<<<
Subject: Resolved: {$Ticket->Subject}

This is an automated message to notify you that ticket [{$rtname}
#{$Ticket->id()}] has been resolved.  Closing comments are included at
the bottom of this message.

Thank you,
{$Ticket->QueueObj->CorrespondAddress()}

-------------------------------------------------------------------------
Ticket Data:
{
 my $CustomFields = $Ticket->QueueObj->CustomFields();
 while (my $CustomField = $CustomFields->Next()) {
   my $CustomFieldValues=$Ticket->CustomFieldValues($CustomField->Id);
   $OUT .= $CustomField->Name;
   if ($CustomFieldValues->Count) {
     my $spacer;
     if ( $CustomField->Type ne 'FreeformMultiple' and
          $CustomField->Type ne 'SelectMultiple' ) {
       $spacer = " " x (20 - length($CustomField->Name));
     } else {
       $spacer = "\n";
     }
     $OUT .= ":" . $spacer;
   } else {
     $OUT .= ":\n";
     next;
   }
   while (my $CustomFieldValue = $CustomFieldValues->Next) {
     $OUT .= " " if ( $CustomField->Type eq 'FreeformMultiple' or
                       $CustomField->Type eq 'SelectMultiple' );
     $OUT .= $CustomFieldValue->Content . "\n";
   }
   $OUT .= "\n" if ( $CustomField->Type eq 'FreeformMultiple' or
                       $CustomField->Type eq 'SelectMultiple' );
 }
 $OUT;
}

-------------------------------------------------------------------------
Closing Comments:

{
 my $resolution_comment;
 my $Transactions = $Ticket->Transactions;
 $Transactions->GotoFirstItem;
 while (my $Transaction = $Transactions->Next) {
   $resolution_comment = $Transaction->Content() if
$Transaction->Type eq 'Comment';
 }
 $OUT .= $resolution_comment;
 $OUT;
}
>>>>>>>>----end----<<<<<<<


-- 
Andy Harrison



More information about the rt-users mailing list