[rt-users] Error

Kevin Falcone falcone at bestpractical.com
Thu Jan 28 12:21:00 EST 2010


On Thu, Jan 28, 2010 at 11:59:35AM +0200, JJussi wrote:
> Hi!
> (using RT 3.8.7)
> I have made simple Perl script to add users and queues to database. 
> However, I get next error message:
> RT::User::Validate Unimplemented in RT::Record. (/opt/rt3/lib/RT/Record.pm line 267)

Most likely, one of the elements of %vars is undef and causing the
list you're passing to Create to contain an empty key.

-kevin

> Script is:
> #!/usr/bin/perl
> # luojono -perl scripti
> use warnings;
> use strict;
> use RT::Interface::CLI qw(CleanEnv);
> use RT::User;
> use RT::Queue;
> use RT::Queues;
> 
> RT::LoadConfig();
> RT::Init();
> 
> my $user = RT::User->new($RT::SystemUser); 
> my $queues = new RT::Queues($RT::SystemUser);
> 
> my $domainosa = 'domain.fi';
> 
> my $uid = $user->Create( 
>   Name          => $vars{nimi},
>   EmailAddress  => $vars{oemail}, 
>   RealName      => $vars{omistaja},
>   FreeformContactInfo
>                 => 'Tiketti omistaja: '.$vars{kuvaus},
>   NickName      => '', 
>   Privileged    => 1,
>   Password      => , 
>   Address1      => '',
>   Address2      => '', 
>   City          => '',
>   State         => '',
>   Zip           => '',
>   Country       => '',
>   WorkPhone     => '',
>   MobilePhone   => '',
> );
>                                                         
> my $qid = $queues->Create(
>   Name                  => $vars{nimi},
>   Description           => $vars{kuvaus},
>   CorrespondAddress     => $vars{nimi}.'@'.$domainosa,
>   CommentAddress        => $vars{nimi}.'-comment@'.$domainosa,
>   InitialPriority       => $vars{minpri},
>   FinalPriority         => $vars{maxpri},
>   DefaultDueIn          => $vars{maxaika},
> );      
> 
> -- 
> JJussi
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 2010 RT Training Sessions!
> San Francisco, CA, USA - Feb 22 & 23
> Dublin, Ireland - Mar 15 & 16
> Boston, MA, USA - April 5 & 6
> Washington DC, USA - Oct 25 & 26
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100128/e72dc337/attachment.sig>


More information about the rt-users mailing list