[rt-users] On Queue Change, what queue scrip acts?

lgrella lgrella at acquiremedia.com
Wed Mar 5 23:05:41 EST 2008


I am trying to set up scrips for my queues so that when a queue is changed,
the owner in the new queue is set to a default queue owner for that new
queue. It is not working. I have some questions about when the scrips are
run....When the onQueueChange scrip is run, is it run from the old queue's
scrip or the new queue's scrip? I am writing it as if it is run in the new
queue - i.e it was in queue A and now it switches to queue B. I want the
scrip to run in queue B that will change it to a default owner for queue B.

Does this make sense? 

The code I use is the same code I used to set a default owner on create, but
commented out a few lines.
This is the code that I have in the custom action clean up code for the new
queue (queue B):

my $MyUser = "default owners id";
###############################
# my $QueueName = "General"; 
# return 1 unless $self->TicketObj->QueueObj->Name eq $QueueName; 
# my $Actor = $self->TransactionObj->Creator; 
# return 1 if $Actor == $RT::SystemUser->id; 
# return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
###############
$RT::Logger->info("Auto assigning ticket #". $self->TicketObj->id ." to user
$MyUser" );
my ($status, $msg) = $self->TicketObj->SetOwner( $MyUser ); 
unless( $status ) {
  $RT::Logger->warning( "Impossible to assign the ticket to $MyUser: $msg"
);
return undef;
}
1;

Does anyone see anything wrong? The owner does not change when switching
queues.

-- 
View this message in context: http://www.nabble.com/On-Queue-Change%2C-what-queue-scrip-acts--tp15866097p15866097.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.




More information about the rt-users mailing list