[rt-users] Status change scrip action

Steve Cochran stephen.cochran at kingarthurflour.com
Mon Jan 21 00:03:22 EST 2008


I'm trying to write a scrip that runs on a status change. I'm trying  
to change the owner to Nobody if a ticket is reopened, and I have the  
following code in the action prep area:

my $oldStatus = $self->TransactionObj->OldValue;
my $newStatus = $self->TicketObj->status;

if (($oldStatus eq 'resolved') and ($newStatus eq 'open') {
    $self->TicketObj->OwnerObj = RT::Nobody()->id();
}

I've run a couple tests through, but nothing seems to be happening.  
First, what's the best way to debug custom action code? Second, if  
anyone seems what I'm doing wrong, feel free to point it out.

Steve



More information about the rt-users mailing list