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.
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
    Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to