[rt-users] Resolve ticket and include message body in ticket
Khusro Jaleel
mailing-lists at kerneljack.com
Tue Jul 7 12:58:44 EDT 2009
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