Why is this not working? Help!?

Ack! It’s driving me up the wall. Here’s what’s giving me so much grief:

—start-of-custom-condition—

skip this scrip if the the transaction is not a status change,

and the new status is not rejected or deleted.

return 0 unless (($self->TransactionObj->Type eq “Status”) && ($self->TransactionObj->NewValue =~ /^(reject|delet)ed$/));

if the owner is nobody, change it to the transaction creator

my $Actor = $self->TransactionObj->CreatorObj->Id;

if (($self->TicketObj->OwnerObj->Id == $RT::Nobody->Id) && ($Actor != $RT::Nobody->Id)) {
$RT::Logger->info(“Auto assign ticket #”.$self->TicketObj->id." to user #".$Actor);
my ($val, $msg) = $self->TicketObj->SetOwner($Actor);
die “Error: $msg” unless ($val);
}

return 1;

—end-of-custom-condition—

For some reason which escapes me, RT answers with the following when I
change the status to rejected or deleted:

* Ticket 794: Status changed from 'open' to 'rejected'
* Owner changed from root to Nobody

In the logs, I get this:

Mar 14 12:43:02 localhost RT: Auto assign ticket #794 to user #12 ((eval 427):9)\n
Mar 14 12:43:02 localhost RT: RT::User=HASH(0xa289dec) was created without a CurrentUser. Any RT object which is subclass of RT::Base must be created with a RT::CurrentUser or a RT::User obejct as the first argument. (/opt/rt3/lib/RT/Base.pm:107)\n
Mar 14 12:43:02 localhost RT: RT::User=HASH(0xa289dec) was created without a CurrentUser. Any RT object which is subclass of RT::Base must be created with a RT::CurrentUser or a RT::User obejct as the first argument. (/opt/rt3/lib/RT/Base.pm:107)\n

I tried as root and a user, but get the same results. Looking at all the
code I can find in the Wiki, this should work!

Thanks,
js.
Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net