AW: [rt-users] Ticket history in ticket resolved message

Torsten Brumm torsten.brumm at
Tue Jul 11 10:28:53 EDT 2006

Hi Marie,


there was an acrticle on the wiki:


but it is removed from dumb spammers.


Here is a copy:





Original author: Michael Markstaller - IFCO


Code cleanups: RuslanZakirov


Require: Text::Wrapper perl module


Subject: Resolved: {$Ticket->Subject}


Dear customer,


your issue regarding




has been resolved in our ticket system. See below for history of this


If you have any further questions or concerns, please reply to this

message to reopen the ticket.




{$Ticket->OwnerObj->RealName || $Ticket->OwnerObj->Name}




  Your initial request was 






  Complete Ticket History




 my $resolved_message = '';

 my $last_content = '';


 my $transactions = $Ticket->Transactions;

 $transactions->Limit( FIELD => 'Type', VALUE => 'Correspond' );


 while (my $transaction = $transactions->Next) {

   my $attachments = $transaction->Attachments;


   while (my $message = $attachments->Next) {

     next unless $message->ContentType =~



     my $content = $message->Content;

     next unless $content;


     next if $last_content eq $content;

     $last_content = $content;


     my $subject = ($message->Subject || $Ticket->Subject);


     my $wrapper = Text::Wrapper->new(columns=>70);

     $content = $wrapper->wrap($content);


     $resolved_message .= "Subject: ";

     $resolved_message .= $subject;

     $resolved_message .= "\n";

     $resolved_message .= "From: ";

     $resolved_message .= $message->CreatorObj->RealName ||

     $resolved_message .= "\n";

     $resolved_message .= "Time: ";

     $resolved_message .= $message->CreatedObj->AsString;

     $resolved_message .= "\n";

     $resolved_message .= "\n";

     $resolved_message .= "$content\n";

     $resolved_message .=







   Common Information



There is no need to reply to this message unless you want to RE-OPEN your 

ticket with ID [{$rtname} #{$Ticket->id}]. 


If you want to simply add a COMMENT to this ticket whithout re-opening the
ticket, click below:

mailto:rt-comment at[{$rtname}%20#{$Ticket->id()}]&body


Please note:

- ALWAYS include the string [{$rtname} #{$Ticket->id}] in the subject line
of all future correspondence about this issue.

- Do NOT attach or include the content of previous emails already sent to
you by rt.




Von: rt-users-bounces at
[mailto:rt-users-bounces at] Im Auftrag von Marie
Gesendet: Dienstag, 11. Juli 2006 09:52
An: rt-users at
Betreff: [rt-users] Ticket history in ticket resolved message




I’m using RT 3.4. 

I would like to include the initial ticket question in the message that is
sent to the requestor when his ticket has been resolved. The problem is that
I don’t want to use an OnResolved template because that would generate two
emails to the requestor (template message + resolve message). So what I want
to do is to add $Ticket->Transactions->First->Content() to the message area
on the Update.html page. But the message area is included
(Elements/MessageBox) so if I add the ticket history text to the MessageBox
all message boxes will display the ticket history. 

There is an argument, UpdateContent, defined in Update.html that is passed
on to the MessageBox, does anyone know if/how I can add my ticket history
text to that argument?


I have searched the wiki and the mailing list but I can’t find any similar
problems, but maybe I’m looking for a bad solution. Any tips or hints in the
correct direction would be appreciated.


Best regards


Marie Gellbäck



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rt-users mailing list