[rt-users] Send last message/comment from ticket to requestor on resolve

Kenneth Crocker KFCrocker at lbl.gov
Mon May 5 14:40:39 EDT 2008


Nelson,


	We created our own template and put the following code in it:
#MAKE SURE YOUR TEMPLATE HAS A BLANK LINE AFTER THE "Subject:" LINE!!!

Subject: Request Titled: "{$Ticket->Subject}" has been Resolved!

This ticket has been resolved. DO NOT REPLY to this message!
-----------------------------------------------------------------------------
TICKET INFORMATION:
Ticket Queue  : {$Ticket->QueueObj->Name}
Ticket Number : {$Ticket->Id}
Ticket Subject: {$Ticket->Subject}
Ticket Description:
      {$Ticket->FirstCustomFieldValue('Description')}

Ticket Priority is: {$Ticket->Priority}
Ticket Requestor  : {$Ticket->Requestors->UserMembersObj->First->Name}
Ticket Created  by: {$Ticket->CreatorObj->Name}
Ticket Created  on: {substr($Ticket->Created, 0, 10)}
Ticket  Owned   by: {$Ticket->OwnerObj->Name}
Development Started on: {substr($Ticket->Started, 0, 10)}
QA Approved on: {$Ticket->FirstCustomFieldValue('QA Approval Date')}
QA Approved by: {$Ticket->FirstCustomFieldValue('QA Approver')}
Migrated    on: {substr($Ticket->Resolved, 0, 10)}
Migrated    by: {$Ticket->LastUpdatedByObj->Name}
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}


	Of course, you will certainly not have the same CF's in your tickets 
and we use the "Comment" not the reply to insert into the template. But 
I think this will give you an idea on how to do this. Hope this helps.

Kenn
LBNL

On 5/5/2008 10:42 AM, Nelson Pereira wrote:
> Hi,
> 
>  
> 
> Wondering how to do this:
> 
>  
> 
> When I resolve a ticket, I want RT to send the message I put in the 
> resolve to the requestor, and not the default “as per our records….”
> 
>  
> 
>  
> 
> *Nelson Pereira*
> Senior Network Administrator
> 
> Protus IP Solutions Inc.
> npereira at protus.com <mailto:npereira at protus.com>
> phone: 613.733.0000 ext.528
> MyFax: 613.822.5083
> www.myfax.com <http://www.myfax.com>
> 
> Refer your friends and colleagues to MyFax!
> Click here for more information. 
> <http://www.myfax.com/referral_program.asp>
> 
> 	
> 
> www.MyFax.com <http://www.myfax.com>
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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