[rt-devel] Moving tickets from many queues to one

Bruce Campbell bruce_campbell at ripe.net
Fri Aug 16 02:31:48 EDT 2002


On Thu, 15 Aug 2002, Grant Miller wrote:

> I'm trying to write up a Perl script to move all tickets from a group of
> queues into one larger queue.  I'm having some difficulty figuring out
> how to get a list of tickets in a queue.  This seems so basic, maybe I'm
> thinking too hard about it.

For examples and whatnot, have a look at the cli 'rt' thats comes with RT.

> 	my $sourcequeue = RT::Queue->new($RT::SystemUser);
> 	$sourcequeue->Load($smallqueue);
>
> #	my $Tickets = RT::Tickets->new($RT::SystemUser);

	$Tickets->UnLimit();
	$Tickets->LimitQueue( VALUE => $sourcequeue->Name,
				OPERATOR => '=' );

	while( my $ticket = $Tickets->Next() ){

> #	    $ticket->SetQueue($destqueue->id);
> #	}
>
>     }

-- 
                             Bruce Campbell                            RIPE
                   Systems/Network Engineer                             NCC
                 www.ripe.net - PGP562C8B1B             Operations/Security





More information about the Rt-devel mailing list