[rt-users] Change Queue Custom Scrip - moves back to original queue after webui reloads

David dev.crash at gmail.com
Wed Oct 26 02:05:59 EDT 2005


Greetings Everyone,

I have created a custom status that I am trying to set a condition on to
move tickets from one queue to another. The code that I have used is....

Condition: On Status Change
Action: User Defined

Custom Condition: return 1;
Custom action preparation code: return 1;
Custom action cleanup code:
#----------------------------------------------------------------
my $TargetQueueName = 'Queue2';
my $NewStatus = 'PassToQueue2';
if (($self->TicketObj->Status eq "$NewStatus") &&
($self->TicketObj->QueueObj->Name ne "$TargetQueueName")) {
my $TicketObj = $self->TicketObj;
my $Id = $TicketObj->Id;
my $Status = $TicketObj->Status;
my $QueueName = $TicketObj->QueueObj->Name;

if ($Status ne $NewStatus) {
my ($tstatus, $tmsg) = $TicketObj->SetStatus("$NewStatus");
$RT::Logger->info("Changing status of ticket #". $Id ." to ". $NewStatus);
unless ($tstatus) {
die "Error: $tmsg";
}
}
if ($QueueName ne $TargetQueueName) {
my ($qstatus, $qmsg) = $TicketObj->SetQueue("$TargetQueueName");
$RT::Logger->info("Moving Ticket #". $Id ." to ". $TargetQueueName ."
Queue.");
unless ($qstatus) {
die "Error: $qmsg";
}
}
}
return 1;
#----------------------------------------------------------------

The ticket moves queues but when the web ui reloads it resets it back to the
old queue.

I appreciate all feedback ....

Thanks.
David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20051026/8433adb1/attachment.htm>


More information about the rt-users mailing list