
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2023 04:25 PM
I'm finally working for a company that wants to setup a good CMDB. What fields does ServiceNow use to determine if a CI is duplicated. I have a couple duplicate CIs in IP Switch class but as far as I can tell the only duplicate field is name. Is that the only field used? Can you make it use other fields per class?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2023 09:15 PM
// Add this code to the onBefore transform map script
// Call CMDB API to do Identification and Reconciliation of the current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.setDataSource('ImportSet');
cmdbUtil.identifyAndReconcileEnhanced(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());
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2023 12:52 AM
Brian,
I am afraid the vendor has mislead you, you can use IRE no problem. I think @Aarti6 has posted the script and told you where it needs to go in your transform map.
As always, try it in a non production environment first to ensure it meets your needs.
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2023 10:43 AM - edited ‎02-15-2023 10:46 AM
@Aarti6 So I added our custom field that we coalesce on to the Identification rules. Then I added your script to an onBefore. The main problem is that it is still showing these CI in ip switch class as duplicates in the CMDB View dashboard.------>
@Brian Lancaster The reason behind this is the records are already created when you have run the transform map. The script given will work onBefore i.e before creating an entry to servicenow target table. Hence you are able to see the duplicates in CMDB view.
Solution to removing it from dashboard - Check if there is active de-duplicate task. If yes you can complete the dedup process to fix the duplicate CI's.
Not all CIs are checked by the Duplicate Metric when the "CMDB Health Dashboard - Correctness Score Calculation" job runs. When CMDB Health - Correctness job runs, the Duplicate Metric only checks CIs that have Identification Rules defined, and also meet one of below conditions:
- One of the duplicated CIs has empty Discovery Source attribute
- There is an active de-duplicate task (reconcile_duplicate_task) for the duplicated CI
To fix all the left-over CIs, please run discovery, or any custom scripts / import engine that calls IRE
Logic behind the Duplicate :
- Is this class independent (in your case IP switch is independent)?
- Yes: Continue
- No: End logic
- Query CIs that meet ALL following conditions:
- ((Discovery_Source = Unknown AND (SYS_UPDATED_ON 1 day ago)) OR (Discovery_Source is Empty))
- Duplicate_Of is Empty
- Meets the conditions from the inclusion rules, cmdb_ie_active_config, for that class
- Iterate over the list of CIs returned in the query
- For each CI call the identification engine
- The identification engine will determine if duplicate and if so create a de-duplication task

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2023 12:14 PM
I ended up deleted the duplicate task record and then rerunning the import and the jobs for the dashboard. Then the dups disappeared.