Why setting CMDB/Asset Serial Number field as Unique to prevent duplicates is not a good idea


Description

Setting the Serial Number field of the CMDB or Asset tables may seem a good idea for preventing Duplicate CIs and Assets, but it really isn't. These are some of the reasons why this is not unique by design, and should stay that way:

Most of these points also apply to other fields in the CMDB, such as as Name, Asset Tag, Correlation ID, etc.

Release or Environment

Any.

Instructions

If you have a company policy or other technical reason why serial numbers in the CMDB or Asset table must be unique, then a less harmful workaround would be to use Abort action Business Rules to accomplish the same thing. These can run on insert or update, and have conditions to apply only to the CI Classes where uniqueness is absolutely required. Your custom business rule logic could also include logging and reporting so that CMDB administrators can try to identify and fix the causes of the 'bad' inserts/updates and avoid it happening.

If the unique constraint is a workaround for Import Sets, then using the Identification Engine in the transform would be the better solution:
Documentation: Apply CI Identification and Reconciliation to Import Sets
API reference: CMDBTransformUtil - Global

If you have already set a CMDB field as Unique and are having problems, then you will need to contact ServiceNow Technical Support, as admin role users cannot delete a unique index once it is created.

Additional Information

The main landing page for the CMDB Identification and Reconciliation feature:
Documentation: CMDB Identification and Reconciliation