On Fri, Nov 19, 2010 at 06:16:08PM +0000, [email protected] wrote: > Thanks for your help Emmanuel. > What's the better ? Perl script or mysql script ? >
Perl script using the RT API, sample untested code, without error checking (get it with ($val, $msg) = method; die $msg unless ( $val ); ): #!/usr/bin/perl -w use strict; use lib "/home/rt/rt/lib"; use RT; use RT::Interface::CLI qw( CleanEnv ); CleanEnv(); RT::LoadConfig(); RT::Init(); my $User = RT::User->new ( $RT::SystemUser ); $User->Create( Name => NAME, EmailAddress => EMAIL, ... ); my $Group = RT::Group->new ( $RT::SystemUser ); $Group->LoadUserDefinedGroup( GROUPNAME ); $Group->AddMember( $User->PrincipalObj->Id );
