Bulk load into Asset Tracker possible?

Greetings,
Before we dive into the RT-APIs at a low level to try to figure out how to load our several hundred rows of excel data semi
automatically into our RT Asset Tracker instance, I just thought it worth asking if anyone else has solved this problem (or
started to?) and might be willing to share code or ideas on how best to proceed. We’ve got a bunch of custom fields (and
obviously some basic fields) that we’ll want to populate. And it may be that we have a small enough data set that doing it
manually through the web interface ends up being a more efficient use of time and resources, but it sure seems worth asking.

   thanks so much in advance for any hints or advice,
        ~c

You might be able to tweak Offline Editor to operate on AT objects
rather than Tickets without too much difficulty?

Greetings,
Before we dive into the RT-APIs at a low level to try to figure out how to load our several hundred rows of excel data semi
automatically into our RT Asset Tracker instance, I just thought it worth asking if anyone else has solved this problem (or
started to?) and might be willing to share code or ideas on how best to proceed. We’ve got a bunch of custom fields (and
obviously some basic fields) that we’ll want to populate. And it may be that we have a small enough data set that doing it
manually through the web interface ends up being a more efficient use of time and resources, but it sure seems worth asking.

Below is a script I wrote that bulk adds data from tab-separated data
into AT, using custom fields we have designed.

#!/usr/bin/perl

use lib qw(/opt/rt3/local/lib /opt/rt3/lib);

use RT;
use RTx::AssetTracker::Asset;
RT::LoadConfig();
RT::Init();

use strict;

MAIN

my $BFILE="/opt/rt3/wslist";


open(BF,"<$BFILE") or die "$!\n";

my $ass = RTx::AssetTracker::Asset->new(RT->SystemUser);

while(<BF>) {
	chomp;
	my @lineparts=split(/\t/);
	my $sysname=$lineparts[4];
	$sysname =~ s/\W.*$//; # Strip from non-word to eol
	$sysname .= $lineparts[5] . "-" . $lineparts[0];
	
	my ($id, undef, undef) = $ass->Create(Type => 'Workstations', 
						Name => "$sysname",
						Status => 'production',
						'CustomField-7' => "$lineparts[0]", # Decal
						'CustomField-3' => "$lineparts[1]", # Make
						'CustomField-4' => "$lineparts[2]", # Model
						'CustomField-8' => "$lineparts[3]", # Serial
						'CustomField-59' => "$lineparts[4]", # Building
						'CustomField-60' => "$lineparts[5]", # Room
						'CustomField-62' => "$lineparts[6]", # MAC address
						);
	print "$sysname created with id $id\n";
}

There was a perl script on the old wiki but it isn’t on the latest wiki
page. I have it on my system and have used it once without any problems.
It needs tweaking. I didn’t want to send it out unless I have the link
to where you can see who wrote it and the caveats. I have it named as
massloadat.pl. So far all of my searching didn’t return anything.

This link takes you to the discussion back in 2006 on this topic.

http://www.gossamer-threads.com/lists/rt/users/59960?search_string=asset%20tracker%20bulk;#59960

John J. Boris, Sr.
JEN-A-SyS Administrator
Archdiocese of Philadelphia
222 North 17th Street
Philadelphia, Pa. 19103
Tel: 215-965-1714
Fax: 215-587-3525
"Remember! That light at the end of the tunnel
Just might be the headlight of an oncoming train!"

charlie derr cderr@simons-rock.edu 6/24/2009 12:00 PM >>>
Greetings,
Before we dive into the RT-APIs at a low level to try to figure
out how to load our several hundred rows of excel data semi
automatically into our RT Asset Tracker instance, I just thought it
worth asking if anyone else has solved this problem (or
started to?) and might be willing to share code or ideas on how best to
proceed. We’ve got a bunch of custom fields (and
obviously some basic fields) that we’ll want to populate. And it may
be that we have a small enough data set that doing it
manually through the web interface ends up being a more efficient use
of time and resources, but it sure seems worth asking.

   thanks so much in advance for any hints or advice,
        ~c

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com