AW: [Rt-devel] Interesting Reset ticket On Queue Change

Ham MI-ID, Torsten Brumm torsten.brumm at Kuehne-Nagel.com
Fri Jul 20 09:51:19 EDT 2007


Hi steven,
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.

Torsten

-----Original Message-----
From: rt-devel-bounces at lists.bestpractical.com <rt-devel-bounces at lists.bestpractical.com>
To: rt-devel at lists.bestpractical.com <rt-devel at lists.bestpractical.com>
Sent: Fri Jul 20 11:14:57 2007
Subject: [Rt-devel] Interesting Reset ticket On Queue Change


Hi all,

I have a UI scrip that reset ticket's status to 'new' and owner to 'nobody'
based on condition 'On Queue Change'.
let's say, userA has the both rights to own tickets in the original queue
and new queue,
userA go to an "opened&taken" ticket modify page, and ONLY change the ticket
to a new queue,
at the same time, the status keep "open (unchanged)" and the owner shown is
still "userA",
after userA 'save changes', the scrip run but the owner keep back!!
Does anyone know why? or I miss something important?

here are history:

Fri Jul 20 08:25:48 2007 RT_System - Status changed from 'open' to 'new'
Fri Jul 20 08:25:48 2007 RT_System - Owner forcibly changed from userA to
Nobody
Fri Jul 20 08:25:48 2007 userA - Given to userA


here are scrip codes, you may have a try

##--------------------------------------------------------------------------
-##

my ($status)= $self->TicketObj->SetStatus("new");
unless( $status ) {
  $RT::Logger->warning( "Impossible to reset the ticket to New" );
  return undef;
}

my $Actor = $self->TransactionObj->Creator;
return 1 if $Actor == $RT::SystemUser->id;
return 1 if $self->TicketObj->Owner == RT::Nobody->id;

my ($status)= $self->TicketObj->SetOwner(RT::Nobody->id ,"Force");
unless( $status ) {
  $RT::Logger->warning( "Impossible to reset the ticket to Nobody" );
  return undef;
}
return 1;

##-------------------------------------------------------------------------#
#



Best Regards,
Steven Liu
HKG RI-CI

Tel: +852 2823 4396
Email: yanfat.liu at kuehne-nagel.com


_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20070720/9f0f5117/attachment.htm


More information about the Rt-devel mailing list