[rt-users] Odd scrip behavior: false positives are triggered, and modifications are made but not txn rescorded

Jerrad Pierce jpierce at cambridgeenergyalliance.org
Thu May 27 12:00:08 EDT 2010


Hi All,

I'm using http://wiki.bestpractical.com/view/RtBounceHandler to detect bounces.
I then have the following scrip flag the bounced tickets, which has
been in place for months:

Custom condition: return 1 unless $self->Subject =~ /Bounce!/;
Custom action: 1;
Custom clean-up: my $curval =
$self->TicketObj->FirstCustomFieldValue('Tags') || '';
unless( $curval =~ /\bbounce\b/i ) {
  my($st, $msg) = $self->TicketObj->AddCustomFieldValue(
   Field => 'Tags',
   Value => 'bounce, ' . $curval,
   RecordTransaction => 1 );
  unless( $st ) {
    $RT::Logger->warning( "Couldn't prepend 'bounce' to CF 'Tags':". $msg );
    return undef;
  }
}
return 1;

It seems to work when it ought, but today I just noticed that a number of
tickets have been tagged as bounce, even though they have no messages
with a subject of Bounce! This seems to occur when comments are added,
but not only on the first such transaction for a ticket. Any idea why,
and how to fix it it a non-kludgy way?

Thanks in advance!

-- 
Cambridge Energy Alliance: Save money. Save the planet.



More information about the rt-users mailing list