[rt-users] Resolve ticket and include message body in ticket

Ken Crocker kfcrocker at lbl.gov
Tue Jul 7 12:43:42 EDT 2009


Khusro,

You do not need a Custom Field to do this. The transaction content is 
available at "Resolve" time via a code in your template. We do this. We 
created our own "Resolve" template and deleted the delivered one. This 
is our code:
==============================================================
Subject: Request Titled: "{$Ticket->Subject}" has been Resolved!

This ticket has been resolved. DO NOT REPLY to this message!
-----------------------------------------------------------------------------
TICKET INFORMATION:
Queue  : {$Ticket->QueueObj->Name}
Number : {$Ticket->Id}
Subject: {$Ticket->Subject}
Priority is: {$Ticket->Priority}
Requestor  : {$Ticket->Requestors->UserMembersObj->First->Name}
Created  by: {$Ticket->CreatorObj->Name}
Created  on: {substr($Ticket->Created, 0, 10)}
Owned    by: {$Ticket->OwnerObj->Name}
Development Started on: {substr($Ticket->Started, 0, 10)}
-----------------------------------------------------------------------------
Description of Issue:
     {$Ticket->FirstCustomFieldValue('Description')}

-----------------------------------------------------------------------------
Resolution comment:
     {
      my $Resolution_Comment;
      my $Transactions;
      my $CommentObj;

      $Transactions = $Ticket->Transactions;
      $Transactions->Limit( FIELD => 'Type', VALUE => 'Comment' );
      $Transactions->OrderByCols(
          { FIELD => 'Created',  ORDER => 'DESC' },
          { FIELD => 'id',     ORDER => 'DESC' },
          );

      $CommentObj = $Transactions->First;

      if  ($CommentObj && $CommentObj->id)
      {
           $Resolution_Comment = $CommentObj->Content;
      }
      else
      {
           $Resolution_Comment = "No comment."
      }

      return $Resolution_Comment;
     }
-----------------------------------------------------------------------------
To view ticket information, enter URL:

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


Hope this helps.

Kenn
LBNL



On 7/7/2009 2:13 AM, Khusro Jaleel wrote:
> Hi,
>
> I'm quite new to RT and wondering how to do the following.
>
> I need to resolve a ticket when an email is sent to the queue resolve 
> address, for example, myqueue-resolve at domain.com. This is fine, and I 
> have managed to do this by adding a new 'rt-mailgate' command with an 
> action of 'resolve' to my /etc/aliases file.
>
> However, the person sending this email will include some text describing 
> the reason for resolving the ticket, among other things, and I would 
> like this text to be added to the ticket when it is resolved and I can't 
> find a way to do this.
>
> I tried creating a custom scrip with a custom template of 
> ${Transaction->Content()} or something like that, but it didn't work.
>
> Any help appreciated.
>
> Thanks,
> Khusro
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
>
>   



More information about the rt-users mailing list