[rt-users] problem with "add comment to dependant tickets" scrip

taan taan at cryologic.com
Tue Jul 18 00:34:09 EDT 2006


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;



More information about the rt-users mailing list