<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
I'm trying to get scrip that on status change set owner to
requestor.<br>
<br>
I used AutoSetOwner
<a class="moz-txt-link-freetext" href="http://requesttracker.wikia.com/wiki/AutoSetOwner">http://requesttracker.wikia.com/wiki/AutoSetOwner</a> scrip and modified
a little.<br>
<br>
It looks like this now:<br>
<br>
<tt>my $Actor = $self->TicketObj->RequestorAddresses;</tt><tt><br>
</tt><tt>$RT::Logger->info("Auto assign ticket #".
$self->TicketObj->id ." to user #". $Actor );</tt><tt><br>
</tt><tt>my ($status, $msg) = $self->TicketObj->SetOwner(
$Actor );</tt><tt><br>
</tt><tt>unless( $status ) {</tt><tt><br>
</tt><tt> $RT::Logger->error( "Impossible to assign the ticket
to $Actor: $msg" );</tt><tt><br>
</tt><tt> return undef;</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt>return 1;</tt><br>
<br>
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:<br>
<br>
<tt> Scrip 14 Commit failed: RT::Ticket::Requestor Unimplemented in
RT::Action::UserDefined. ((eval 528) line 1)</tt><br>
<br>
With <tt>RequestorAddresses </tt>is almost working but...:<br>
<br>
<tt>[Thu Nov 21 10:42:19 2013] [info]: Auto assign ticket #77 to
user #Bartosz.Maciejewski@maildomain.pl ((eval 497):2)</tt><tt><br>
</tt><tt>[Thu Nov 21 10:42:19 2013] [error]: Impossible to assign
the ticket to <a class="moz-txt-link-abbreviated" href="mailto:Bartosz.Maciejewski@maildomain.pl">Bartosz.Maciejewski@maildomain.pl</a>: That user does
not exist ((eval 497):5)</tt><br>
<br>
And to have whole scope - my username in this RT is <b>bmaciejewski</b>,
and this is exactly what I want to have under $Actor - there this
scrip should work.<br>
<br>
<tt>[Thu Nov 21 10:44:47 2013] [info]: Ticket 78 created in queue
'MO.Uzdatnianie.Wody' by <b>bmaciejewsk</b><b>i</b>
(/opt/rt4/sbin/../lib/RT/Ticket.pm:694</tt><br>
<br>
<br>
<br>
<tt> </tt>
</body>
</html>