<!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 <rt-devel-bounces@lists.bestpractical.com><BR>
To: rt-devel@lists.bestpractical.com <rt-devel@lists.bestpractical.com><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 "opened&taken" ticket modify page, and ONLY change the ticket<BR>
to a new queue,<BR>
at the same time, the status keep "open (unchanged)" and the owner shown is<BR>
still "userA",<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->TicketObj->SetStatus("new");<BR>
unless( $status ) {<BR>
$RT::Logger->warning( "Impossible to reset the ticket to New" );<BR>
return undef;<BR>
}<BR>
<BR>
my $Actor = $self->TransactionObj->Creator;<BR>
return 1 if $Actor == $RT::SystemUser->id;<BR>
return 1 if $self->TicketObj->Owner == RT::Nobody->id;<BR>
<BR>
my ($status)= $self->TicketObj->SetOwner(RT::Nobody->id ,"Force");<BR>
unless( $status ) {<BR>
$RT::Logger->warning( "Impossible to reset the ticket to Nobody" );<BR>
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>