Modifing users

I want to do same export from a software that I use into rt.
New users and disable users work.
Now I want to modify users in rt when I modify a user in the other software.
But I can’t make get the UpdateRecordObject to work.

I do like this:
use lib “/opt/rt3/lib”;
use strict;
use English;
use RT::Interface::Web qw(UpdateRecordObject);
use RT::User;
RT::LoadConfig();
RT::Init();
my $UserObj = RT::User->new(RT::SystemUser);
$UserObj->LoadByEmail(‘cynet5@ambra.ro’);
my @fields = qw(Name);
my %ARGS;
$ARGS{‘Name’} = ‘New value’;
UpdateRecordObject(AttributesRef => @fields,
Object => $UserObj,
ARGSRef => %ARGS
);

But the erorr is :
[Tue Nov 4 09:50:08 2003] [crit]: Undefined subroutine
&main::UpdateRecordObject called at ./rt.modify line 27.
(/opt/rt3/lib/RT.pm:242)

Thank you

I want to do same export from a software that I use into rt.

please don’t ask question twice.

But I can’t make get the UpdateRecordObject to work.

it’s been a bit since I started at the code, but when I did this, I
didn’t use UpdateRecordObject. It doesn’t sound familer. Here’s most
of my subroutine:

set up the attributes array:

my %user_attributes;
$user_attributes{‘Name’} = $user_name;
$user_attributes{‘Gecos’} = $login;

let’s create an rt user object, and we’ll see

my $user_obj = new RT::User($CurrentUser);
$user_obj->Load($user_name);

alrighty, create the user, if they don’t exist.

unless ($user_obj->id) {
print “User ‘$user_name’ not found, creating\n” if($verbose);
my ($status, $msg) =
$user_obj->Create( %user_attributes );

print "$msg\n" if($verbose);

}

if they already exist, let’s just frob them…

else {
# now that we know we have a user, let’s set it’s attributes
# this bit of code lifted from rtadmin
my @attributes = (‘Name’, ‘Gecos’,
‘EmailAddress’, ‘Privileged’, ‘Comments’, ‘Signature’,
‘Organization’, ‘RealName’, ‘NickName’,
‘ExternalContactInfoId’, ‘ContactInfoSystem’,
‘ExternalAuthId’, ‘AuthSystem’,
‘HomePhone’, ‘WorkPhone’, ‘MobilePhone’, ‘PagerPhone’,
‘Address1’, ‘Address2’, ‘City’, ‘State’, ‘Zip’,
‘Country’, ‘FreeformContactInfo’);
foreach my $attrib (@attributes) {
if ( (exists ($user_attributes{"$attrib"})) and
($user_obj->$attrib() ne $user_attributes{"$attrib"})) {

    my $method = "Set$attrib";
    my ($val, $msg) = $user_obj->$method($user_attributes{"$attrib"});
    print "User ".$user_obj->Name. " $attrib:  $msg\n" if($verbose);

  }
}

seph

Thank you.
It works.