- 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
‎10-26-2017 02:28 PM
Do you have the correct classes in the flat file? If you want to be curren then iterate through them in a script and call the IdentificationEngine- passing the class from your flat file in the Json. Then the function will handle the rest possibly with some CI identifier assistance if not under the hardware or child classes.
https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=IdentificationEngineScopedAPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 02:49 PM
This is great and TY for sharing. I will have a look and see if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2017 07:28 AM
Hello Christian. I see the script but how do I insert a field/variable for one of the values in the name/value pairs. It does not seem to accept the variable(ex:current.short_description). Implies it wants it in JSON format but not sure if that is the case and how to do that.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2017 09:29 AM
I see the script but how do I insert a field/variable for one of the values in the name/value pairs. It does not seem to accept the variable(ex:current.short_description). Implies it wants it in JSON format but not sure if that is the case and how to do that.
thanks
Example:
name:'stry0900844 CI 2',
name: current.short_description,