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". > _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: sa...@bestpractical.com Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com