[rt-users] Template to include All ticket content on resolve

Kyle Thomas kyle at avalontel.com
Mon Jun 6 15:24:51 EDT 2011


Ok Here is what I found in the old archives 

 

On resolve it is putting in the "Initial request" content fine but it is not
including the complete ticket history it only shows 

----------------------------------------------------------------

Complete Ticket History

----------------------------------------------------------------

 

And does not show any of the comments or correspondence in the ticket . Can
anyone take a look at my code I have under complete ticket history and
suggest why it is not including the history??? 

 

 

 

 

 

 

 

Subject: Resolved: {$Ticket->Subject} 

 

Dear customer,

 

 

 

according to our records your issue regarding

 

 

 

"{$Ticket->Subject()}",

 

 

 

has been resolved in our ticket system. 

 

 

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

 

message to reopen the ticket or email (our email)  to open another ticket. 

 

Regards,

 

Our Name 

 

 

----------------------------------------------------------------

 

Your initial request was

 

----------------------------------------------------------------

 

 

 

{$Ticket->Transactions->First->Content()}

 

 

----------------------------------------------------------------

Complete Ticket History

----------------------------------------------------------------

 

 

 

 

{

my $resolved_transaction;

my $resolved_message = "";

my $last_content;

my $Transactions = $Ticket->Transactions;

$Transactions->OrderBy;

$Transactions->GotoFirstItem;

while (my $Transaction = $Transactions->Next) {

if ($Transaction->Type eq 'Correspond') {

$resolved_transaction = $Transaction;

} elsif (!$Transactions->IsLast) {

$resolved_transaction = undef;

}

 

if ($resolved_transaction) {

 

my $attachments = $resolved_transaction->Attachments;

$attachments->GotoFirstItem;

 

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

next unless $message->ContentType =~

m!^(text/plain|message|text$)!i;

 

my $content = $message->Content;

if ($last_content eq $content) {

$content = undef; }

next unless length $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 ." (".$rtname.")";

$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;

}

 

 

 

 

 

 

Kyle 

 

  _____  

From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Kyle Thomas
Sent: Monday, June 06, 2011 2:06 PM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] Template to include All ticket content on resolve

 

Can anyone share with me a template that will include all of the tickets
contents/transactions when resolved? The default resolve template has a URL
link but I do not want my customers going to the URL and I would just like
to include the entire ticket history contents on resolve 

 

 

Kyle 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110606/435e9d71/attachment.htm>


More information about the rt-users mailing list