RT-3.6.0

I have a very basic scrip (see below, copied from the Wiki) which adds a comment from one ticket to the tickets it is depended on by.

The queue with the dependant tickets uses out of the box scrips and notifies owners when a comment is added.

If I trigger the below scrip "On Resolve" the owner of the dependant ticket is sent one email with "Reviewer's notes: some text here" in the body.
Note, I am not resolving the dependant ticket, just adding a comment to it.

However if I trigger the scrip "On Comment" the owner of the dependant ticket is sent two emails. One with "Reviewer's notes: some text here" in the body, and the other with "Reviewer's notes:" in the body, missing the comment.

The strange thing is the dependant ticket history only contains a log for one email being sent, the one containing the comment.

I apologise in advance for my lack of perl-sense.

Taan


SCRIP:

my $note;
my $t = $self->TicketObj->Transactions;
while (my $o = $t->Next) {
     $note = $o->Content() if
     $o->Type eq 'Comment';
}

foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) {
    $obj->Comment(
        Content => $self->loc( "Reviewer's notes: [_1]", $note
        ),
    );
}
return 1;
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


We're hiring! Come hack Perl for Best Practical: 
http://bestpractical.com/about/jobs.html

Reply via email to