How can we prevent Duplicate CI for Name+Serial Number IRE combination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 10:38 PM
Hi All,
We have changed the OOB IRE rule for Server table to look for Name + Serial Number combination. So if a server comes in with a matching Serial Number and Name IRE will update the existing records. In certain cases, Discovery couldn't fetch the serial number from the target servers and IRE is creating a duplicate CI. One CI - Name & Empty Serial Number, second CI- Same name with Serial number value. Initially we thought of entering serial number values for cmdb_serial_number manually to avoid the issue, but it didn't work as expected. Whenever Discovery is bringing empty serial number its creating a duplicate in the system. Any suggestions will be helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 11:08 PM - edited 12-03-2023 11:09 PM
Maybe it's a bug about Discovery.
What about collecting all the logs and raise an HI CASE..
And what I can suggest is to create a trigger (before insert) and check if the CI has both a name and a Serial Number. If the Serial Number is missing, reject the insert action and store the CI information in a custom table or raise an email to notify the team.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 11:11 PM
Hi @newhand Thanks for your response, How can we create a trigger? I do not have any idea about it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 11:33 PM
@Suvetha S
To create a business rule , you can refer this link。
https://docs.servicenow.com/bundle/sandiego-api-reference/page/script/business-rules/concept/c_Busin...
Basically,
Define a trigger.
Specify some conditions.
Write your logic script.
And here, you can use the code below to reject the insert.
current.setAbortAction(true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 11:56 PM
HI @Suvetha S ,
I trust you are doing great.
To address the issue of duplicate Configuration Items (CIs) being created in ServiceNow due to missing serial numbers, the suggestion to create a business rule (before insert trigger) is a practical approach. This business rule can check whether both the name and serial number are present for a CI. If the serial number is missing, the rule can either reject the insertion of the CI or take alternative actions like logging the information or sending a notification.
if (!current.serial_number) {
current.setAbortAction(true);
// Optionally, add code here to log the information or send notifications
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi