<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>AW: [Rt-devel] Interesting Reset ticket On Queue Change</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi steven,<BR>
I'm fighting with the same at the moment, but I think this is a normal rt way of acting, because you can only change the owner of the ticket if it is unowned or you are the owner and I think this action is done by the rt system user.<BR>
<BR>
Torsten<BR>
<BR>
-----Original Message-----<BR>
From: rt-devel-bounces@lists.bestpractical.com &lt;rt-devel-bounces@lists.bestpractical.com&gt;<BR>
To: rt-devel@lists.bestpractical.com &lt;rt-devel@lists.bestpractical.com&gt;<BR>
Sent: Fri Jul 20 11:14:57 2007<BR>
Subject: [Rt-devel] Interesting Reset ticket On Queue Change<BR>
<BR>
<BR>
Hi all,<BR>
<BR>
I have a UI scrip that reset ticket's status to 'new' and owner to 'nobody'<BR>
based on condition 'On Queue Change'.<BR>
let's say, userA has the both rights to own tickets in the original queue<BR>
and new queue,<BR>
userA go to an &quot;opened&amp;taken&quot; ticket modify page, and ONLY change the ticket<BR>
to a new queue,<BR>
at the same time, the status keep &quot;open (unchanged)&quot; and the owner shown is<BR>
still &quot;userA&quot;,<BR>
after userA 'save changes', the scrip run but the owner keep back!!<BR>
Does anyone know why? or I miss something important?<BR>
<BR>
here are history:<BR>
<BR>
Fri Jul 20 08:25:48 2007 RT_System - Status changed from 'open' to 'new'<BR>
Fri Jul 20 08:25:48 2007 RT_System - Owner forcibly changed from userA to<BR>
Nobody<BR>
Fri Jul 20 08:25:48 2007 userA - Given to userA<BR>
<BR>
<BR>
here are scrip codes, you may have a try<BR>
<BR>
##--------------------------------------------------------------------------<BR>
-##<BR>
<BR>
my ($status)= $self-&gt;TicketObj-&gt;SetStatus(&quot;new&quot;);<BR>
unless( $status ) {<BR>
&nbsp; $RT::Logger-&gt;warning( &quot;Impossible to reset the ticket to New&quot; );<BR>
&nbsp; return undef;<BR>
}<BR>
<BR>
my $Actor = $self-&gt;TransactionObj-&gt;Creator;<BR>
return 1 if $Actor == $RT::SystemUser-&gt;id;<BR>
return 1 if $self-&gt;TicketObj-&gt;Owner == RT::Nobody-&gt;id;<BR>
<BR>
my ($status)= $self-&gt;TicketObj-&gt;SetOwner(RT::Nobody-&gt;id ,&quot;Force&quot;);<BR>
unless( $status ) {<BR>
&nbsp; $RT::Logger-&gt;warning( &quot;Impossible to reset the ticket to Nobody&quot; );<BR>
&nbsp; return undef;<BR>
}<BR>
return 1;<BR>
<BR>
##-------------------------------------------------------------------------#<BR>
#<BR>
<BR>
<BR>
<BR>
Best Regards,<BR>
Steven Liu<BR>
HKG RI-CI<BR>
<BR>
Tel: +852 2823 4396<BR>
Email: yanfat.liu@kuehne-nagel.com<BR>
<BR>
<BR>
_______________________________________________<BR>
List info: <A HREF="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel</A><BR>
</FONT>
</P>

</BODY>
</HTML>