How does the IRE script work in import set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 09:01 AM
Hi all,
Below is the IRE script I have which I created on a custom transform map. the script is mostly out of box that I got from the SN Docs site.
So, by reading the code, it seems the coalesce rules on the transform map would probably be ignored because the code always does a 'ignore=true' as per line 7. Is this assumption correct?
Thanks,
Ravish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 07:39 PM
@Ravish Shetty Please look at the CMDBTransformUtil script include it calls IRE using scoped API below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Yes, I assume so, rather the IRE will be used(as CMDBTransformUtil will take care of it) which will update/insert the records based on Identification and Reconciliation rule setup in your servicenow instance. Could someone else clarify this here in the community.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
Hi @Ravish Shetty ,
No, the ignore is set for a different reason.
To prevent the transform from adding or updating the record a second time, set ignore = true.
CMDBTransformUtil - identifyAndReconcile(Object source, Object map, Object log)
It’s an onBefore transform map, which means the IRE will perform its task before the data is written to the database. It will then determine for you whether a record needs to be created or updated and manipulates the payload accordingly.
Is your line 5 working? The examples use the cmdbUtil object for that as well and they set it before the identifyAndReconcile() call.
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.setDataSource('ImportSet');
cmdbUtil.identifyAndReconcile(source, map, log);
ignore = true;
In case you’re interested in testing your IRE Rules before e.g. the go live, I’ve written an article on that subject: Identification Simulation: Testing IRE Rules and Creating Mock Data
Hope this helps!
