Interface::CLI and Queue auto-create

I have read the docs–thoroughly–and searched the list archives, but I
am not finding what I need to do this.

I perldoc all the wonderful files, and the API seems documented
clear as day.

But when I try and do a “use RT::Queue” and then “my $new_q = new
RT::Queue()” nothing happens.

I’ve checked out several of the scripts on the RTWiki/Contributions site
hoping to find inspiration, but nothing seems to work!

How do I get the object I need to call all these wonderfully documented
APIs that I can’t seem to get any acces to???

Thanks,

Jens

I have read the docs–thoroughly–and searched the list archives, but I
am not finding what I need to do this.

I perldoc all the wonderful files, and the API seems documented
clear as day.

But when I try and do a “use RT::Queue” and then “my $new_q = new
RT::Queue()” nothing happens.

I’ve checked out several of the scripts on the RTWiki/Contributions site
hoping to find inspiration, but nothing seems to work!

How do I get the object I need to call all these wonderfully documented
APIs that I can’t seem to get any acces to???

Thanks,

Jens

What? No one?

Here’s my script. It doesn’t seem to do anything.

#!/usr/bin/perl

use strict;
use warnings;

use lib '/opt/rt3/lib';
use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent loc);

CleanEnv();

use RT;
use RT::Queue;
use RT::Queues;

#load RT's config file
RT::LoadConfig();

# Connect to the database. set up logging
RT::Init();

#Get the current user all loaded
my $CurrentUser = GetCurrentUser();

print loc("what does this loc method do anyhow?\n"); # Synonym of $CurrentUser->loc('Hello!');

my $nq = new RT::Queue($CurrentUser);
#my $nq = RT::Queues->NewItem();

$nq->Create({       Name => "FOOOOOOOOOOOOO",
					Description =>  "testdesc",
					CorrespondAddress => "foo",
					CommentAddress => "bar",
					InitialPriority => "12",
					FinalPriority => "43"
			});

my $nq = new RT::Queue($CurrentUser);

$nq->Create({ Name => “FOOOOOOOOOOOOO”,
Description => “testdesc”,
CorrespondAddress => “foo”,
CommentAddress => “bar”,
InitialPriority => “12”,
FinalPriority => “43”
});

OK, so I change that bit there to:

my ($id, $err) = $nq->Create({  Name => "FOOOOOOOOOOOOO",
								Description =>  "testdesc",
								CorrespondAddress => "foo",
								CommentAddress => "bar",
								InitialPriority => "12",
								FinalPriority => "43"
							}) or warn "Create failed\n"; #warn doesn't do anything...

print STDERR "$err\n" if $err;

Which gives me:

station:~# perl foo.pl
Queue could not be created

and when I print the value of $CurrentUser 's id:

print STDERR "User id is: " . $CurrentUser->PrincipalId() . "\n";

I get ‘12’–which the database tells me is root.

But if I’m root, how come I don’t have permissions to autocreate queues?

Jens