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

Ken Crocker kfcrocker at lbl.gov
Tue Jul 7 13:08:12 EDT 2009


Khusro,

The "Notify AdminCcs as Comment" won't send out an email. At least that 
is my understanding. So, if I'm right, some other scrip is sending out 
the email and therefore your new template is probably NOT being used. Of 
course, if I'm wrong about the "as Comment", then ignore my response.

Kenn
LBNL


On 7/7/2009 9:58 AM, Khusro Jaleel wrote:
> Ken Crocker wrote:
>> 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;
>>     }
>
> I tried entering just the above into a new Template and then created a 
> Scrip that would run "On Resolve". I told the scrip to use this new 
> template, however, all I got in the end was
>
> -----------------------------
> Resolution Comment:
>     No comment
> -----------------------------
>
> I definitely entered a few words into the body of the resolved email 
> message. So clearly I've missed something off? I have a feeling it 
> should not be $Transactions->First? Wouldn't that give you just the 
> first Transaction when we are looking for the last one?
>
> The scrip I'm using is set as "On Resolve, Notify AdminCCs as Comment, 
> Template MyNewResolvedTemplate, Stage TransactionCreate".
>



More information about the rt-users mailing list