[rt-users] getting the current queue name and how to move the ticket to another queue?

Ruslan U. Zakirov cubic at acronis.ru
Sat Apr 24 09:11:47 EDT 2004

Swinkels, Marcel wrote:
> Hi,
> despite reading the RTWiki pages I still don't know how I can get the
> name (not the number) of the queue in which the ticket is in, using
> scrip-code. I also cannot find how I can move the ticket from one queue
> to the other using the name of the queue.

my $CurrentQueueName = $TicketObj->QueueObj->Name.

my $QueueObj = RT::Queue->new( $self->CurrentUser );
$QueueObj->Load( 'ToQueueName' );
unless( $QueueObj->id ) {
	die "Can't load queue";
$TicketObj->SetQueue( $QueueObj->id );

> What I want to do is the following. A ticket comes in, the IP address is
> filtered out and a query is made on the database to see to which country
> the IP address belongs. That output is stored in a customfield. That all
> works fine. I also know how to read the value of a CF. Our queues are
> named like f.i. chello abuse AT, chello abuse NL etc. The CF contains
> the country code. Our pre-filtering is done by procmail, but because
> some people still mail to the wrong abuseaddress, it is possible that a
> complaint for chello.at gets into the chello abuse NL queue. Therefor I
> want to get the name of the current queue and regexp it to see if
> there's a match (countrycode AT = chello abuse AT?) If the ticket is in
> the wrong queue I want to move it to the correct queue.
> Can someone tell me how I can:
> - get the name of the current queue into a variable
> - move a ticket to another queue using the name of it
> Thank you very much in advance for any response.
> Regards,
> Marcel Swinkels
> chello abuse
> UPC Nederland
> mswinkels at upc.nl
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> RT Developer and Administrator training is coming to LA, DC and Frankfurt this spring and summer.
> http://bestpractical.com/services/training.html
> Sign up early, as class space is limited. 

More information about the rt-users mailing list