<& /Elements/Header, Title => loc("Asset Import") &> <& /AssetTracker/Elements/Tabs, current_tab => "AssetTracker/Search/Export.html", Title => loc("Asset Import") &> <& /Elements/ListActions, actions => $results &>
Run scrips: Detailed transactions:

The format of the import file is very important. The best way to get the correct format is to do an asset search and click "Importable Spreadsheet." Make all changes in this spreadsheet and import it.

Run scrips: Will run scrips for every transaction. Don't run scrips if you don't have to. If there is an error during import the datanase will be rolled back (changes undone), but if a scrip happens to do a database commit then transactions cannot be rolled back on error.

Detailed transactions: When an existing asset is updated an "Update" transaction will be recorded, unless this option is selected which will cause a transaction to be recorded for every change in the asset. <%INIT> my $results = []; unless (RT->Config->Get("AssetImportRequiresRights") && $session{CurrentUser}->HasRight( Object => $RTx::AssetTracker::System, Right => 'AssetImport')) { $m->abort; } if ($Import && $XML) { my $cgi_object = $m->cgi_object; my $fh = $cgi_object->upload('XML'); my $filename = "$fh"; my ($buffer, $xml_data); while ( my $bytesread = read( $fh, $buffer, 4096 ) ) { $xml_data .= $buffer; } my $assets = RTx::AssetTracker::Assets->new($session{CurrentUser}); my $rv; eval { ($rv, $results) = $assets->ImportXML($xml_data, $RunScrips, $Detailed); unshift @$results, loc("Asset import errors. No changes were made.") unless $rv; }; if ($@) { unshift @$results, loc("Asset import exception: [_1]", $@) unless $rv; } } <%ARGS> $Import => undef $XML => '' $RunScrips => 0 $Detailed => 0