[rt-users] Transction content empty during On Correspond

Paul Glendenning paul.glendenning at sensorynetworks.com
Wed Aug 4 02:21:39 EDT 2004


Hi,

I'm a RT and perl newbie.

We have RT set up at our office for bugs and support. Bugs come into RT and enter a Bugs-unconfirmed queue. A custom scrip forwards
the bug request to bugzilla which has been setup with mailif to allow bugs to be added via an email.  The bugzilla bug has the
[$rtname #$Ticket->id] in the short description so this appears in the subject line of correspondence with bugzilla. This all works.

Whenever the bugzilla sends the bug owner (rt-queue-comment) a status update RT runs a custom scrip with a user defined action. The
scrip appears below. The purpose is to move the ticket to a different queue depending on the status.

In my scrip the content appears to be empty.

Can anyone help?

-Paul

-------------------------------
Description: NotifyFromBugzilla
Condition: On Correspond
Action: User Defined
Template: Global Template
Stage: TransactionCreate
Custom condition:
Custom action preparation code: 1;
Custom action cleanup code:

my $status_change = 0;
my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $content = $Transaction->Content();

foreach my $line (split /^/, $content) {
  if (/What\s*\|Removed\s*\|Added/) {
    $status_change = 1;
  } elsif ($status_change == 1) {
    if (/Status\|[A-Z]+\s*\|RESOLVED|VERIFIED|CLOSED/) {
      # Change queue, bug has been resolved.
      my ($status, $msg) = $Ticket->SetQueue("Bugs-resolved");
      unless( $status ) {
        die "Error processing bugzilla notify: $msg";
      }
      last;
    } elsif (/Status\|[A-Z]+\s*\|NEW|ASSIGNED|REOPENED/) {
      # Change queue, assume bug has been verified.
      my ($status, $msg) = $Ticket->SetQueue("Bugs-verified");
      unless( $status ) {
        die "Error processing bugzilla notify: $msg";
      }
      last;
    }
  }
}
return 0;




More information about the rt-users mailing list