[rt-users] Forward ticket as e-mail?

Jay Lee jlee at pbu.edu
Thu Oct 27 15:14:05 EDT 2005


Steven E. Ames wrote:
> I checked the FAQ and couldn't find this... there are times when it would be handy to forward the contents of a ticket (perhaps with a handy comment at the top) to someone outside the ticket system for their input... at present I copy/paste into a seperate e-mail and send it but that lacks because:
> 
> 1. Its more complicated;
> 2. No record in the ticket that I sent said e-mail;
> 3. The 3rd parties response is not automatically added to the ticket.
> 
> I don't want to add them as a CC or AdminCC as that is even more complicated and then all other CC/AdminCC would get copies of my query to the 3rd party which is undesirable.
> 
> So basically what I want is an additional option (to Reply and Comment) called 'Forward'?

I've modified my reply and comment templates so that the entire ticket 
history is attached also (comments include everything, replies only the 
replies).  Thus if I make a comment or reply, I can CC: any third party 
and they get the full ticket history.  The other advantage is that users 
have a full ticket history every time a ticket is updated.  One downside 
is that when users reply, they forget to delete the reply text so their 
reply includes the entire work order history, but most of our work 
orders don't go beyond 3-4 replies for us so it's not a big deal.  Here 
are my templates:

Correspondence Template:

RT-Template: Correspondence
Organization: Philadelphia Biblical University
RT-Attach-Message: yes

---------------------------------------------------------------
New Response Regarding Your Work Order
---------------------------------------------------------------
{$Transaction->Content()}

----------------------------------------------------------------
Initial User Work Order:
----------------------------------------------------------------
{$Ticket->Transactions->First->Content()}

----------------------------------------------------------------
Work Order 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;
}


Admin Correspondence Template:

RT-Template: Admin correspondence
Organization: Philadelphia Biblical University
RT-Attach-Message: yes

<URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >

---------------------------------------------------------------
New Response Regarding Work Order: 
{$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
---------------------------------------------------------------

{$Transaction->Content()}

----------------------------------------------------------------
Your Initial User Work Order Was:
----------------------------------------------------------------

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

----------------------------------------------------------------
Work Order 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;
}
-- 
Jay Lee
Network / Systems Administrator
Information Technology Dept.
Philadelphia Biblical University
--



More information about the rt-users mailing list