<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Mike,<br>
<br>
You didn't get my code correct. You forgot the "Force". (NO, I'm NOT
saying "may the force be with you", gaagh!). <br>
Also, when creating a scrip, you must keep in mind that when you define
the condition as :User-Defined", you SHOULD end with a return code in
both the "Prep" & "Cleanup" areas. Since my code is in the
"Cleanup" area, I have a "return 1;" in the "Prep" area. That way RT
knows to continue on to the cleanup area. So, to re-cap, your code
should look something like this:<br>
<br>
Condition: On whatever<br>
Action: User-Defined<br>
<br>
Custom Prep Code:<br>
Return 1;<br>
<br>
Custom Cleanup Code:<br>
<br>
# set new Ticket Owner value<br>
my $ticket = $self->TicketObj;<br>
$ticket->SetStatus('new');<br>
$ticket->SetOwner(10, 'Force');<br>
return 1;<br>
<br>
That should do it. Hope this helps.<br>
<br>
Kenn<br>
LBNL<br>
<br>
On 9/25/2009 6:55 AM, Mike Johnson wrote:
<blockquote cite="mid:4ABC9395.4EF5.001E.0@NorMed.ca" type="cite">
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta name="GENERATOR" content="MSHTML 8.00.6001.18812">
  <div>Hi Kevin,</div>
  <div> </div>
  <div>Thx for that tidbit of info,</div>
  <div> </div>
  <div>In that file I found the correct syntax, out of Sean's set, the
2 below will work,</div>
  <div> </div>
  <div>$self->TicketObj->SetOwner("Nobody");</div>
  <div>
  <div>$self->TicketObj->SetOwner("10");</div>
  <div> </div>
  <div>But, this is baffling me...</div>
  <div> </div>
  <div>This is my scrip</div>
  <div> </div>
  <div>Condition: On Queue Change</div>
  <div>Action: User Defined</div>
  <div>Custom action Preparation Code:</div>
  <div># set new Ticket Owner value<br>
my $ticket = $self->TicketObj;<br>
$ticket->SetStatus("new");<br>
$ticket->SetOwner("Nobody");<br>
  </div>
  <div> </div>
  <div>Based on the above investigation, I know the syntax is correct
for the SetOwner.  However, the only thing that happens on queue change
is the ticket's status is set to new.  That shows up in the ticket
history.  The SetOwner doesn't show up at all, nothing happens.</div>
  <div> </div>
  <div>This is the exact same spot Sean got stuck.... and the thread
ended.....</div>
  <div> </div>
  <div> </div>
  <div>Ken Crocker(thx Ken) provided the above code + 1 line (return
1;) and said his is in the cleanup code spot.  If I put that code in
there, absolutely nothing gets changed in the ticket...</div>
  <div> </div>
  <div>Any thoughts anyone?</div>
  <div> </div>
  <div> </div>
  <div> </div>
  <div> </div>
  <div> </div>
  <div>
  <div>Mike Johnson<br>
Datatel Programmer/Analyst<br>
Northern Ontario School of Medicine<br>
955 Oliver Road<br>
Thunder Bay, ON   P7B 5E1<br>
Phone: 807.766.7331<br>
Email: <a moz-do-not-send="true" href="mailto:mike.johnson@normed.ca">mike.johnson@normed.ca</a></div>
  <div>Technology assistance: email <a moz-do-not-send="true"
 href="mailto:nosmhelpdesk@normed.ca">nosmhelpdesk@normed.ca</a> <br>
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat
holidays: <br>
Off campus toll free 1-800-461-8777, option 8, or locally either <br>
(705)-662-7120 or (807)-766-7500<br>
  </div>
  <br>
  <br>
>>> Kevin Falcone <a class="moz-txt-link-rfc2396E" href="mailto:falcone@bestpractical.com"><falcone@bestpractical.com></a> 24/09/2009
5:06 pm >>><br>
On Thu, Sep 24, 2009 at 04:02:10PM -0400, Mike Johnson wrote:<br>
>    I was looking through the list's history.<br>
> <br>
>    The original email did not get an answer to it.<br>
> <br>
>    The piece that interests me about this listserv topic(dating
back to Aug 2007)....<br>
> <br>
> <br>
>    Sean, and myself are trying to set a ticket's owner to nobody
on an action...<br>
> <br>
>    He stated,<br>
> <br>
>    I've tried:<br>
> <br>
>    $self->TicketObj->SetOwner("Nobody");<br>
>    $self->TicketObj->SetOwner(Nobody);<br>
>    $self->TicketObj->SetOwner("10");<br>
>    $self->TicketObj->SetOwner(10);<br>
>    $self->TicketObj->SetOwner(Name => "Nobody");<br>
>    $self->TicketObj->SetOwner(Name => Nobody);<br>
>    $self->TicketObj->SetOwner(Id => "10");<br>
>    $self->TicketObj->SetOwner(Id => 10);<br>
> <br>
>    None of these has worked and nothing in rt.log indicates any
problems.  I have<br>
>    it set up with debug so I know I'm getting as much info as I
can.<br>
  <br>
If you want as much information as possible, you should check the<br>
return values of SetOwner.  The arguments for the SetOwner method are<br>
documented in Ticket_Overlay.pm.<br>
  <br>
-kevin<br>
  <br>
>    Can anyone tell me which of the above? and what else do I need
to set to make this happen on a<br>
>    specific condition(I'm using On Queue change).<br>
  </div>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
<a class="moz-txt-link-freetext" href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a>

Community help: <a class="moz-txt-link-freetext" href="http://wiki.bestpractical.com">http://wiki.bestpractical.com</a>
Commercial support: <a class="moz-txt-link-abbreviated" href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at <a class="moz-txt-link-freetext" href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a></pre>
</blockquote>
</body>
</html>