[rt-users] Problem with AddTicketHistoryToMail Template

John Edwards John.Edwards at stiprepaid.com
Tue Nov 18 17:22:31 EST 2008


I can use the exact template in a 3.7.2 environment without any issues.

The problem area in the template which produces no output in 3.8.1 (the section is just blank) is:

----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------
{
 my $resolved_message = '';
 my $last_content = '';

 my $transactions = $Ticket->Transactions;
$transactions->Limit( FIELD => 'Type',
VALUE => 'Correspond',
ENTRYAGGREGATOR => 'OR',
OPERATOR => '=',  );

$transactions->Limit( FIELD => 'Type',
VALUE => 'Comment',
ENTRYAGGREGATOR => 'OR',
OPERATOR => '=',  );


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

   while (my $message = $attachments->Next) {
     next unless $message->ContentType =~
              m!^(text/plain|message|text$)!i;

     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 || $message->CreatorObj->EmailAddress;
     $resolved_message .= "\n";
     $resolved_message .= "Time: ";
     $resolved_message .= $message->CreatedObj->AsString;
     $resolved_message .= "\n";
     $resolved_message .= "\n";
     $resolved_message .= "$content\n";
     $resolved_message .= "------------------------------------------------\n";
   }
 }
 $resolved_message;
}



Anyone have any ideas, or workarounds?

Thanks

From: John Edwards
Sent: Tuesday, November 18, 2008 12:35 PM
To: 'rt-users at lists.bestpractical.com'
Subject: Problem with AddTicketHistoryToMail Template

I've tried using the template from http://wiki.bestpractical.com/view/AddTicketHistoryToMail and the entire template works perfectly with the exception of displaying the ticket history.

This is a clean 3.8.1 install, no migration and only one queue.  I get no errors and no other issues with the installation, the history displays in the web interface perfectly.

Thanks


-        John




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20081118/5ab824bb/attachment.htm>


More information about the rt-users mailing list