Bulk queue create?

Is it possible? I have 30+ queues to create, is it possible to create
the queues directly on the database or using a script?

Thanks.

[]s

Dont do this directly to the DB, use some RT Rest functions.

Try this both files:

#!/usr/bin/perl
use strict;
use warnings;

BEGIN { die “You must define $RT_HOME\n”
unless exists $ENV{RT_HOME} };
use lib “$ENV{RT_HOME}/lib”;

use RT;
RT::LoadConfig();
RT::Init();

use RT::Interface::CLI qw(GetCurrentUser loc);
use RT::Tickets;

my $CurrentUser = GetCurrentUser();
die loc(“No RT user found.\n”) unless ($CurrentUser->Id);
die “We need Arguments like Queuename, Description and Mail Address\n”
unless ($#ARGV==2);
my $Queuename=shift @ARGV;
my $Queuedescription=shift @ARGV;
my $Queuemail=shift @ARGV;
my $Queue = RT::Queue->new($CurrentUser);
my
($id,$Message)=$Queue->Create(Name=>$Queuename,Description=>$Queuedescription,CorrespondAddress=>$Queuemail);
if ($id){
print $Message.“\n”;
}
else{
print"This is a error!\n$Message\n";
}
called from a shell script:

#!/bin/bash
P1=/opt/rt3/local/bin/
U1=/opt/rt3/local/bin/queuelist

while read zeile; do
set – $zeile
echo "Bearbeite Queue: "$1 $2 $3
/usr/bin/perl ${P1}createqueue.pl $1 $2 $3
done<$U1

Try it, its much more secure.2007/10/24, José de Paula Eufrásio Júnior jose.junior@mds.gov.br:

Is it possible? I have 30+ queues to create, is it possible to create
the queues directly on the database or using a script?

Thanks.

s


The rt-users Archives

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we’ll
take
up to 20 percent off the price. This sale won’t last long, so get in touch
today.
Email us at sales@bestpractical.com or call us at +1 617 812 0745.

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

MFG

Torsten Brumm

http://www.torsten-brumm.de

Torsten Brumm wrote:

my $CurrentUser = GetCurrentUser();

What user is this? The one I’m logged on the shell? It’ll resolve it to
a RT user?

Is there a way to specify what user it’ll use?

s
core