[rt-devel] can´t create new queue with perl-script
Tina Schade
Tina.Schade at gmx.de
Wed Feb 11 03:52:00 EST 2004
Today I tied to create a new queue per script a few times in different ways,
firstly only with the two parameters Name and Disabled, later with the other
parameters and now it works. I don´t know where the mistake was.
Maybe someone has an explanation.
> Hello,
>
> ich changed rt from version rt3.0.6 to rt3.0.8. Now I tried with my old
> perl scripts to create new queues. But it doesn´t work. The script worked
> with the old version of rt.
> Have I put more includes in it? Or what goes wrong? I don´t understand
> where my mistake is.
>
> Thanks for help, Tina
>
> Here my code of the script.
>
> #! /usr/bin/perl -w
>
> use strict;
> use lib '/opt/rt3/lib';
> use lib '/opt/rt3/etc';
>
> use RT;
>
> #Load RT's config file
> RT::LoadConfig();
> # Connect to the database. set up logging
> RT::Init();
>
> # inlude modules which are a child of RT::SearchBuilder
> use RT::Queues;
> use RT::CustomFields;
>
>
> my $queue = RT::Queue->new($RT::SystemUser); # a new queue-instance
> print( "neues leeres Objekt $queue angelegt. \n" );
>
> # create a new queue
> $queue->Create(Name => 'Bugs', Description => 'alle eingehenden Fälle, die
> eine Fehlfunktion darstellen', CorrespondAddress =>
> 'bugs-correspond at chili-radiology.com', CommentAddress =>
> 'bugs-comment at chili-radiology.com', InitialPriority => 10, FinalPriority
> => 20, DefaultDueIn => 20, Disabled => 1);
> print( "Queue $queue angelegt. \n" );
>
> my $id = $queue->id();
> #here comes an error, which is:Trying to check RT::Queue rights for an
> #unspecified RT::Queue (/opt/rt3/lib/RT/Principal_Overlay.pm:355) -> does I
> #have to put another user then $RT::SystemUser???
> print( "id = $id\n" );
> my $name = $queue->Name();
> print( "Name = $name\n" );
>
> exit(0);
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/mailman/listinfo/rt-devel
More information about the Rt-devel
mailing list