How to restrict duplicate ci creation on cmdb_ci_server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi Team
we don't have discovery we are creating cis using transform map and creating manually also if required
so please suggest how to restrict duplicate ci creation based on same name in servicenow
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @vamshi2
There is no out-of-the-box way to handle this. The only option is to make the name a single column and view it, but if the name contains formats like abc_abc or abc abc, both are technically treated as two separate names. This always presents a challenge.
https://noderegister.service-now.com/kb?id=kb_article_view&sysparm_article=KB0829103
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2219334
https://noderegister.service-now.com/kb?id=kb_article_view&sysparm_article=KB0869861
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @vamshi2 ,
please find the below recommended solutions -
1. Use Identification Rules (IRE) even without Discovery
- ServiceNow’s Identification and Reconciliation Engine can still be leveraged for imports.
- Configure Identification Rules for each CI class:
- Include attributes like name, serial_number, or asset_tag as unique identifiers.
- When a transform map runs, IRE checks if a CI with those identifiers exists and updates instead of creating a new record.
- This prevents duplicates at the source.
2. Enforce Unique Name via Dictionary Constraints
- On the cmdb_ci table (or specific CI class tables), set the Name field to unique=true in the dictionary.
- Alternatively create a business rule
(function executeRule(current, previous /*null when async*/) {
var existing = new GlideRecord(current.getTableName());
existing.addQuery('name', current.name);
existing.query();
if (existing.next()) {
gs.addErrorMessage('CI with this name already exists.');
current.setAbortAction(true);
}4. Governance & Process Controls
- Define a naming convention for CIs (e.g., include environment, location, and type).
- Restrict CI creation to authorized roles and enforce validation scripts.
- For transform maps:
- Use onBefore script to query existing CIs by name and update instead of insert.
- This stops inserts when a CI with the same name exists.
3. Configure CMDB Health Duplicate Check
- ServiceNow provides Duplicate CI Health Rules:
- Create a health rule on cmdb_ci or targeted classes.
- Filter by install_status != retired to avoid false positives.
- These rules generate de-duplication tasks for remediation.
- Use CMDB Workspace > De-duplication Dashboard for visibility and bulk cleanup -KB article
- Use onBefore script to query existing CIs by name and update instead of insert.
NOTE -
Relying only on name can be risky—combine with other identifiers (serial number, IP, etc.).
If you have multiple CI classes, apply rules per class.
For large-scale imports, always test in sub-production first.
Thanks,
Rithika.ch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @vamshi2 ,
It is unusual that you don't have Discovery set up in your instance, as it is the recommended approach for bringing CIs into the instance.
However, since your organization prefers to manage CIs using Excel imports with transform maps,
I recommend following the steps below to prevent duplicate CI creation in your CMDB:
- Establish a Naming Convention:
Define and enforce a consistent naming convention for CIs (e.g., servers). If you plan to use the Name field as the unique identifier, set it as a coalesce field in your Transform Map. - Use Serial Number as the Primary Identifier (Recommended) ✔️:
Serial numbers are unique for each server. Configure the Serial Number field as a coalesce field in your Transform Map. This ensures duplicates are avoided since the Identification and Reconciliation Engine (IRE) also prioritizes Serial Number as the top identifier, followed by Name (second priority). - Consider Robust Transform Maps (Optional):
If possible, implement a Robust Transform Map, which adheres to IRE rules by default and helps maintain data integrity. - Monitor CMDB Health:
Set up and regularly review the CMDB Health Dashboard to identify and remediate duplicate CIs or other data quality issues.
If my response helped you, please consider marking it as "Accept as Solution"✔️ and "Helpful" 👍.
Doing so makes it easier for other community members to find the right answers and helps strengthen our community.