[rt-users] How to use Requestor user in scrip?

Bartosz Maciejewski b.maciejewski at agriplus.pl
Thu Nov 21 06:56:19 EST 2013


Hi,

I'm trying to get scrip that on status change set owner to requestor.

I used AutoSetOwner http://requesttracker.wikia.com/wiki/AutoSetOwner 
scrip and modified a little.

It looks like this now:

my $Actor = $self->TicketObj->RequestorAddresses;
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to 
user #". $Actor );
my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
unless( $status ) {
   $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
   return undef;
}
return 1;

But here is tricky part for me - how to get real Requestor username 
instead od its email address? Putting Requestor or Requestors end with 
error:

  Scrip 14 Commit failed: RT::Ticket::Requestor Unimplemented in 
RT::Action::UserDefined. ((eval 528) line 1)

With RequestorAddresses is almost working but...:

[Thu Nov 21 10:42:19 2013] [info]: Auto assign ticket #77 to user 
#Bartosz.Maciejewski at maildomain.pl ((eval 497):2)
[Thu Nov 21 10:42:19 2013] [error]: Impossible to assign the ticket to 
Bartosz.Maciejewski at maildomain.pl: That user does not exist ((eval 497):5)

And to have whole scope - my username in this RT is *bmaciejewski*, and 
this is exactly what I want to have under $Actor - there this scrip 
should work.

[Thu Nov 21 10:44:47 2013] [info]: Ticket 78 created in queue 
'MO.Uzdatnianie.Wody' by *bmaciejewsk**i* 
(/opt/rt4/sbin/../lib/RT/Ticket.pm:694



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20131121/26ca280d/attachment.htm>


More information about the rt-users mailing list