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

Marie Gellbäck marie.gellback at
Tue Jul 11 11:00:33 EDT 2006

Thank you for your reply.


I have seen this solution in the wiki but it is not what I want to do. I
want to include the ticket history in the message that is sent when you are
on the Update.html page and choose the Resolve link, and finally write some
information in the message area. The update type is set to Reply to

The solution I have come up with so far is to modify the Update.html page so
that it passes the ticket history to the message area that displays it
(overwrite Elements/MessageArea). It currently works but it is a rather ugly

Another way to solve the problem would be to make sure that the Update.html
page doesn’t send any emails to the requestors and then use an
OnResolveTemplate as Torsten purposed. I’m not sure what’s best.




Marie Gellbäck




Från: Torsten Brumm [mailto:torsten.brumm at] 
Skickat: den 11 juli 2006 16:29
Till: 'Marie Gellbäck'; rt-users at
Ämne: AW: [rt-users] Ticket history in ticket resolved message


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