Assign ticket owner to nobody on resolve

Hello,

ich take the script from wiki Request Tracker Wiki an modified it.
My script looks like:

condition: on resolve
action: user defined
template: global template: blank
stage: transaction create

custom action preparation code:
return 1;

custom action cleanup code:
my $owner = $RT::Nobody->id;
my ($status, $msg) = $self->TicketObj->SetOwner( $owner );
unless( $status ) {
$RT::Logger->error( “Impossible to assign the ticket to $owner on resolve: $msg” );
return undef;
}
return 1;

The error log says:
Impossible to assign the ticket to 10 on resolve: You can only reassign tickets that you own or that are unowned ((eval 515):4)

On this point i am the owner of the ticket.
If i change the owner on the resolve page everything works fine.

Why does this script doesn’t work?
Any ideas?

Thanks
Chris

At Monday 2/26/2007 11:02 AM, Loos, Christian wrote:

Hello,

ich take the script from wiki
Request Tracker Wiki an modified it.
My script looks like:

condition: on resolve
action: user defined
template: global template: blank
stage: transaction create

custom action preparation code:
return 1;

custom action cleanup code:
my $owner = $RT::Nobody->id;
my ($status, $msg) = $self->TicketObj->SetOwner( $owner );
unless( $status ) {
$RT::Logger->error( “Impossible to assign the ticket to $owner on
resolve: $msg” );
return undef;
}
return 1;

The error log says:
Impossible to assign the ticket to 10 on resolve: You can only
reassign tickets that you own or that are unowned ((eval 515):4)

On this point i am the owner of the ticket.
If i change the owner on the resolve page everything works fine.

Why does this script doesn’t work?
Any ideas?

I’d guess that when the scrip runs, the CurrentUser is not you - so
RT thinks someone else is trying to change the ticket ownership. Try
adding’Force’ as a second argument to the SetOwner call.

Look in $RTHOME/lib/RT/Ticket_Overlay.pm ( SetOwner method) to see
what’s going on

Steve