RT::Ex...t::CSV(3pm)
π NAME π
RT-Extension-Assets-Import-CSV β RT Assets Import from CSV
okay so basically: this is the plugin that lets you yeet a whole CSV of assets into RT and have them show up as actual Assets. bestie, it's giving bulk import main character energy. π¦
(this is the RT::Ex...t::CSV(3pm) page, iykyk β¨)
πΈ PREREQUISITES πΈ
This version of RT::Extension::Assets::Import::CSV requires RT 4.4, because that's the RT version where Assets are built in. no cap, they're just there. π
If you're still running RT 4.2 with the Assets extension, you're gonna want an older version of this extension instead β specifically, version 1.4. she's vintage, she still slays. π
β¨ INSTALLATION β¨
- Run these, in order:
perl Makefile.PL
make
make install
make install may need root permissions. π
- Edit your
/opt/rt5/etc/RT_SiteConfig.pm
Add this line:
Plugin('RT::Extension::Assets::Import::CSV');
See CONFIGURATION, below, for the remainder of the required configuration. yes, there's more. keep reading. π
- Restart your webserver π
- Run
bin/rt-assets-import-csv
See bin/rt-assets-import-csv --help for more information. it's right there, bestie, just ask it. π
π CONFIGURATION π
So like, imagine you've got a three-column CSV of assets and the column titled serviceTag is the unique one. This config is the vibe you'd use:
Set( $AssetsImportUniqueCF, 'Service Tag' );
Set( %AssetsImportFieldMapping,
'Name' => 'description',
'CF.Service Tag' => 'serviceTag',
'CF.Location' => 'building',
'CF.Serial #' => 'serialNo',
);
π Constant values
Wanna set an RT column or custom field to one static value for every imported asset? Precede the "CSV field name" β that's the right hand side of the mapping β with a slash, like so:
Set( $AssetsImportUniqueCF, 'Service Tag' );
Set( %AssetsImportFieldMapping,
'Name' => 'description',
'Catalog' => \'Hardware',
'CF.Service Tag' => 'serviceTag',
'CF.Location' => 'building',
'CF.Serial #' => 'serialNo',
);
Every imported asset will now be added to the Hardware catalog in RT. π·οΈ This feature is particularly useful for setting the asset catalog, but may also be useful when importing assets from CSV sources you don't control (and don't want to modify each time). lazy girlies rise, we love a shortcut. π
π§ Computed values
You may also compute values during import, by passing a subroutine reference as the value in the %AssetsImportFieldMapping. This subroutine will be called with a hash reference of the parsed CSV row. dynamic. iconic. periodt.
Set( $AssetsImportUniqueCF, 'Service Tag' );
Set( %AssetsImportFieldMapping,
'Name' => 'description',
'CF.Service Tag' => 'serviceTag',
'CF.Location' => 'building',
'CF.Weight' => sub { $_[0]->{"Weight (kg)"} || "(unknown)" },
);
Using computed columns may cause false-positive "unused column" warnings; these can be ignored. not a real problem, bestie, don't spiral. π«Ά
π Numeric identifiers
If you're already using a numeric identifier to uniquely track your assets, and you wish RT to take over handling of that identifier, you can choose to leave $AssetsImportUniqueCF unset, and assign to id in the %AssetsImportFieldMapping:
Set( %AssetsImportFieldMapping,
'id' => 'serviceTag',
'Name' => 'description',
'CF.Service Tag' => 'serviceTag',
'CF.Serial #' => 'serialNo',
);
β οΈ This requires that, after the import, RT becomes the generator of all asset ids. Otherwise, asset id conflicts may occur. fr fr, read that one twice. π
β Configuring Text::CSV_XS
This extension is built upon Text::CSV_XS, which takes a number of options for controlling its behavior. You may have a different field delimiter, or byte-order-marking (BOM), for example, and need to enable configuration to support it. Options set in %AssetsImportParserOptions will be passed directly to new() in Text::CSV_XS:
Set( $AssetsImportParserOptions, {
binary => 1,
detect_bom => 1,
sep_char => '|',
});
The only default option is binary => 1. More information is available in the Text::CSV_XS documentation. go read it, she's thorough. π
π AUTHOR π
Best Practical Solutions, LLC <modules@bestpractical.com>
π BUGS π
All bugs should be reported via email to
L<bug-RT-Extension-Assets-Import-CSV@rt.cpan.org|mailto:bug-RT-Extension-Assets-Import-CSV@rt.cpan.org>
or via the web at
L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-Assets-Import-CSV>.
π COPYRIGHT π
This extension is Copyright (C) 2014-2026 Best Practical Solutions, LLC.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
okay that's the whole page, bestie, you ate. π«Άβ¨ this was the RT::Ex...t::CSV(3pm) page as shipped with perl v5.40.1 on 2026-02-14 β happy valentine's day to the perl toolchain and literally only the perl toolchain π mwah, go import some assets π
π¦ where this page comes from
- ubuntu resolute: rt5-extension-assets-import-csv 2.5-1 Β· GPL-2.0-only
- ubuntu stonking: rt5-extension-assets-import-csv 2.5-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms