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

Torsten Brumm torsten.brumm at kuehne-nagel.com
Tue Jul 11 10:28:53 EDT 2006


Hi Marie,

 

there was an acrticle on the wiki:
http://wiki.bestpractical.com/index.cgi?AddTicketHistoryToMail

 

but it is removed from dumb spammers.

 

Here is a copy:

 

AddTicketHistoryToMail

 

 

Original author: Michael Markstaller - IFCO

 

Code cleanups: RuslanZakirov

 

Require: Text::Wrapper perl module

 

Subject: Resolved: {$Ticket->Subject}

 

Dear customer,

 

your issue regarding

 

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

 

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

 

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

message to reopen the ticket.

 

regards

 

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

your-company-fooprint

 

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

  Your initial request was 

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

 

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

 

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

  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 =~

              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;

}

 

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

   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 yourdomain.com?subject=[{$rtname}%20#{$Ticket->id()}]&body
=%20

 

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 lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] Im Auftrag von Marie
Gellbäck
Gesendet: Dienstag, 11. Juli 2006 09:52
An: rt-users at lists.bestpractical.com
Betreff: [rt-users] Ticket history in ticket resolved message

 

Hello,

 

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

Developer

 

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


More information about the rt-users mailing list