- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 12:35 PM
I have over 40 different CI classes that are in flat file format that need ongoing import to the CMDB and want to avoid having one import/transform per CI Class.
Solved! Go to Solution.
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 07:05 AM
Michael.Fry solution is probably the simplest, BUT make sure that the value for the sys_class_name is valid or you will mess things up real quick (typos will kill you). You could add something like this to the end of Michael's script in order to validate the data before it's inserted:
var test = new GlideRecord(target.getValue("sys_class_name"));
if (!test.isValid()) {
ignore = true; //will skip this one row
gs.addErrorMessage("whatever message you want to add to the logs, if any");
}
It just tries to create a new record (will not actually save it though) and then checks to see if the record is valid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2017 07:05 AM
Your transform map target table can only be 1 table. So choosing Windows table, that's the table where all the records will import into.
But if you choose the top table, cmdb_ci and use the IF script, you can route to appropriate extended table based on some variable in your import data.
You could try adding class in your field mappings, but not sure it will find the right table based on import data. Worth a try.