[Rt-devel] Interesting Reset ticket On Queue Change

HKG RI-CI/LIU, YANFAT yanfat.liu at kuehne-nagel.com
Fri Jul 20 05:14:57 EDT 2007


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




More information about the Rt-devel mailing list