[rt-users] Approval Notes problem

Michael Hogan mhogan30 at gmail.com
Mon Nov 12 08:34:16 EST 2007


I have set up an approval queue that works great with one small issue.  When
I approve a ticket and add notes my notes show up two times in the original
ticket.  So if I type "This is ok to do"  I will get:

<URL: http://rt.bestpractical.com:80/Ticket/Display.html?id=86 >

this is ok to do

<URL: http://rt.bestpractical.com:80/Ticket/Display.html?id=86 >

this is ok to do

In my approval queue there is a scrip for "When a ticket has been approved
by any approver, add correspondence to the original ticket".  This scrip has
a custom action preperation code of the following:

# ------------------------------------------------------------------- #
return(0) unless ($self->TicketObj->Type eq 'approval');

my $note;
my $t = $self->TicketObj->Transactions;
while (my $o = $t->Next) {
$note .= $o->Content . "\n" if $o->ContentObj
and $o->Content !~ /Default Approval/;
}

foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) {
$obj->Comment(
Content => $self->loc( "Your request has been approved by [_1]. Other
approvals may still be pending.", # loc
$self->TransactionObj->CreatorObj->Name,
) . "\n" . $self->loc( "Approver's notes: [_1]", # loc
$note
),
);
$T::Approval = $self->TicketObj; # so we can access it inside templates
$self->{TicketObj} = $obj; # we want the original id in the token line
}

# Now magically turn myself into a Requestor Notify object...
require RT::Action::Notify; bless($self, 'RT::Action::Notify');
$self->{Argument} = 'Requestor'; $self->Prepare;

return 1;
# ------------------------------------------------------------------- #

I am not very good with perl so any help would be appreciated.  It would
appear it has something to do with the for or while loop.  I just don't know
how to fix it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20071112/b9059b8c/attachment.htm>


More information about the rt-users mailing list