IRE and Web Service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2020 08:10 AM
Hello everyone,
The IRE works Only with a set of data source?
I'm using a Inbound Web Service to create or update CI into CMDB, and I set discovery_source field with "WS" value.
Do I use IRE API into scripted rest api?
Otherwise,
Do I implement all Logic to create or update CI on CMDB without using Identificativo Rule?
I guess that even the Reconciliation rule Will not work with the Web Service.
Right?
- Labels:
-
Discovery
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2020 08:40 AM
Hi -- While I'm not sure about invoking IRE via web service (haven't done that...), the new & free online CMDB course recently published by ServiceNow training covers how to invoke the IRE from an inbound import. Perhaps this will help as your explore similar capabilities via inbound services.
Free, online CMDB Fundamentals course here:
In particular, for your question - see the section about Populating the CMDB discusses imports and invoking the IRE via script during transform
Hope this helps some? Please post reply if you get this invoked via web service - it'd be good to know...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 02:39 AM
Hi Dave,
thanks for answer:
I create an Import Set table (with releated REST api to create record on the table),
I attached a Transform map to the Import Set with "On Before" scripted:
(function runTransformScript(source, map, log, target) {
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.setDataSource('MySource1'); //This is the name you added in the step above.
cmdbUtil.identifyAndReconcile(source, map, log);
ignore = true;
if (cmdbUtil.hasError()) {
var errorMessage = cmdbUtil.getError();
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}
})(source, map, log, target);
When the Import Set WS is called the record on CMDB is created or updated following the current Identification and Reconciliation rule configurated on the ServiceNow instance, but the WS answer me with the same response:
{
"import_set": "ISET0010004",
"staging_table": "u_cmdb_ci_mysource1_staging",
"result": [
{
"transform_map": "TransformMapName",
"table": "cmdb_ci_server",
"status": "error",
"error_message": "Target record not found",
"status_message": "Row transform ignored by onBefore script"
}
]
}
I guess it's happening because there is ignorance to true (which is strictly recommended by the docs .. otherwise it doesn't work properly)
The Data Source that call the ServiceNow WS to import CI,expect the response in a format like this:
{
"ServerName" : "ServerName_Created_or_Updated",
"Status" : "Updated / Created"
}
Furthermore...
When the CI is previously discovered (and therefore with Discovery Source = ServiceNow), the Discovery Source field changes from "ServiceNow" to "MySource1", and I cannot see it on Discovery Schedule report as Discovered CI.
This no longer allows me to check whether a particular CI has actually been previously discovered except by using the Last discovere date column.
I should have more evidence of CI discovered by discovery but updated from other sources (as in my case). Is OOTB possible? Or do I have to create a custom report?
Best regards,
Gaetano
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2020 10:12 AM
The suggested approach is for global scope import set table, transofrm script. If you are working on Scoped application, it will be little different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 02:51 AM
IRE is not Datasource specific. Also if you are using IRE the recociliation rules also work with that.
Why are you saying that Reconciliation rule will not work with REST API web service? Do you have any example to highlight this concern?