Thanks Kevin, I searched the wiki but didn't find this page. Here is what I did for my problem. It only print the last correspondance/comment. This is sent in my case to the owner for an owner change, and to the adminccs of the queue for a queue change.
To put in the template used for owner change or queue change: { my $txns = $Ticket->Transactions; $txns->Limit( FIELD => 'Type', VALUE => $_, ) for qw(Create Correspond Comment); my $last_content; my $AttachmentObjects = $txns->Last()->Attachments; while( my $at = $AttachmentObjects->Next()){ next if $at->ContentType !~ m!^(text/html|text/plain|message|text$)!i; $last_content = $at->Content; } $last_content =~ s/<(([^ >]|\n)*)>//g; # strip HTML tags from text/html $last_content; } Looks ok so far... -- L.B. -------- 2011 Training: http://bestpractical.com/services/training.html