Greetings Everyone,<br>
<br>
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....<br>
<br>
Condition: On Status Change<br>
Action: User Defined<br>
<br>
Custom Condition: return 1;<br>
Custom action preparation code: return 1;<br>
Custom action cleanup code:<br>
#----------------------------------------------------------------<br>
my $TargetQueueName = 'Queue2';<br>
my $NewStatus = 'PassToQueue2';<br>
if (($self->TicketObj->Status eq "$NewStatus") &&
($self->TicketObj->QueueObj->Name ne "$TargetQueueName")) {<br>
my $TicketObj = $self->TicketObj;<br>
my $Id = $TicketObj->Id;<br>
my $Status = $TicketObj->Status;<br>
my $QueueName = $TicketObj->QueueObj->Name;<br>
<br>
if ($Status ne $NewStatus) {<br>
my ($tstatus, $tmsg) = $TicketObj->SetStatus("$NewStatus");<br>
$RT::Logger->info("Changing status of ticket #". $Id ." to ". $NewStatus);<br>
unless ($tstatus) {<br>
die "Error: $tmsg";<br>
}<br>
}<br>
if ($QueueName ne $TargetQueueName) {<br>
my ($qstatus, $qmsg) = $TicketObj->SetQueue("$TargetQueueName");<br>
$RT::Logger->info("Moving Ticket #". $Id ." to ". $TargetQueueName ." Queue.");<br>
unless ($qstatus) {<br>
die "Error: $qmsg";<br>
}<br>
}<br>
}<br>
return 1;<br>
#----------------------------------------------------------------<br>
<br>
The ticket moves queues but when the web ui reloads it resets it back to the old queue.<br>
<br>
I appreciate all feedback ....<br>
<br>
Thanks.<br>
David.<br>