Rights to untake a ticket?

Heh… I’m being incredibly stupid, but I just can’t seem to see where.

I have a Scrip that removes the owner of a ticket upon a certain status of a
Custom Field. The condition works fine, but I’m doing something incredibly
wrong in the Custom Action but just cannot for the life of me see where.
Could anybody pass their eyeball(s) over this and maybe let me know what I’m
doing wrong?

Custom action cleanup code:

my $retval = undef;

my $curr_owner = RT::User->new($RT::SystemUser);
$curr_owner->Load( $self->TicketObj->Owner );
$RT::Logger->info("Current owner: " . $curr_owner->Name);

$retval = $self->TicketObj->Untake;
$RT::Logger->info("UnAssign: Result code is: $retval");

return ($retval);

Ok, this actually runs, but I get this result in the log file:

[info]: Current owner: xxxxx ((eval 2163):6)
[info]: UnAssign: Result code is: You can only reassign tickets that

you own or that are unowned ((eval 2163):9)

Now, I’ve checked and re-checked that the user xxxxx DOES own the ticket.
The user can manually set the owner to Nobody via the webpage. This user
also has full rights… they’ve got the ModifyTicket right, and I even gave
them SuperUser access. However this script just continuously fails to work.

If anybody has any suggestions I would be most appreciative.

Damien Lederer

Ahh, I found my own problem by inserting a stack of debugging into
Ticket_Overlay.pm

I assumed that the Scrip was run by the user who was logged in to the web
ui. However the Scrip was REALLY being run as user RT_System (id: 1). So I
changed my code to:

$retval = $self->TicketObj->SetOwner( $RT::Nobody->UserObj->Id,

‘Force’);

And it works!

Hopefully this might help somebody in the future.

- Damien

$retval = $self->TicketObj->Untake;
$RT::Logger->info(“UnAssign: Result code is: $retval”);

return ($retval);

Ok, this actually runs, but I get this result in the log file:

[info]: Current owner: xxxxx ((eval 2163):6)
[info]: UnAssign: Result code is: You can only reassign tickets that
you own