Duplicate knowledge article numbers for two completely different articles

Arpit1012
Tera Contributor

We have observed instances where the same knowledge article number is assigned to completely different knowledge articles, leading to data inconsistency and confusion.

We are currently evaluating approaches to identify such duplicates and implement corrective measures.

Could anyone please suggest:

  1. How can we effectively identify duplicate knowledge article numbers in ServiceNow (e.g., using scripts, reports, or queries)?
  2. What would be the best/feasible solution to resolve this issue, ensuring uniqueness and preventing such inconsistencies going forward?

Any recommended best practices or real-time use cases would be highly appreciated.

3 REPLIES 3

vaishali231
Kilo Sage

Hey @Arpit1012 
Duplicate Knowledge Article Numbers are generally not expected in ServiceNow, as article numbers are typically generated automatically by the platform. If the same article number is associated with multiple knowledge records, it usually indicates that a custom process, import, migration, or integration has bypassed the standard numbering mechanism.
How to Identify Duplicate Knowledge Article Numbers
You can use a GlideAggregate script to quickly identify duplicate article numbers:

var ga = new GlideAggregate('kb_knowledge');
ga.addAggregate('COUNT', 'number');
ga.groupBy('number');
ga.addHaving('COUNT', '>', 1);
ga.query();

while (ga.next()) {
gs.print('Article Number: ' + ga.getValue('number') +
' | Count: ' + ga.getAggregate('COUNT', 'number'));
}

You can also create a report on the Knowledge [kb_knowledge] table, grouped by the Number field with a count aggregation, to identify duplicates without scripting.
Recommended Investigation
Before correcting the data, I would recommend determining how the duplicates were created. Common causes include:
Data imports or migrations
Transform Maps with incorrect coalesce settings
Custom Business Rules or Fix Scripts
Integrations creating records directly
Manual updates to the Number field
Custom number generation logic
Reviewing audit history, import logs, and customizations on the Knowledge table can help identify the root cause.
Corrective Actions
The appropriate resolution depends on the business scenario:
Scenario 1: Duplicate number assigned to different articles
Assign a new unique article number to one of the records.
Validate any related references or links.
Scenario 2: Duplicate records contain the same content
Retain the authoritative article.
Retire, archive, or merge the duplicate record.
Scenario 3: Duplicates created through migration or integration
Correct the source process.
Clean up existing duplicate records.
Re-run imports if required.
Preventing Future Duplicates
To avoid similar issues in the future, consider:
Enforcing uniqueness on the article number field (after existing duplicates are resolved).
Adding validation through a Before Insert/Before Update Business Rule.
Validating data within Import Sets and Transform Maps.
Restricting manual updates to the Number field.
Implementing periodic health checks to identify duplicate article numbers proactively.
Best Practice
My recommended approach would be:
Identify all duplicate article numbers using a GlideAggregate script or report.
Investigate the source of the duplicates before making changes.
Correct existing records based on business requirements.
Implement validation controls to enforce uniqueness.
Review imports, integrations, and customizations to prevent recurrence.
In most cases, duplicate Knowledge Article Numbers are caused by data migration, import activities, or custom processes rather than standard platform behavior. Addressing the root cause is essential to ensure long-term data integrity.

*************************************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb

 

Tanushree Maiti
Tera Patron

Hi @Arpit1012 

 

1) Refer KB: KB3011716 Two articles have the same KB ID and I need to change one ASAP 

Resolution

Steps to Resolve
1. Create a new version or duplicate of the article that needs to be changed, which will generate a new KB number.
2. Publish the new article.
3. Retire the duplicate article that should no longer be used.
4. Update any existing links to ensure they reference the correct article (preferably using sys_id-based URLs).
5. Confirm which article you would like to keep with the duplicated KB.

 

2) refer KB: KB1220880 Two Different Knowledge Articles have the same KB Number 

Resolution

Although it's rare, this issue can happen when the Knowledge Articles are in different Knowledge Bases.

Unique numbering is not enforced on the platform by default.

To fix this, you can create a Before Insert Business Rule on the Knowledge Table (kb_knowledge) to ensure the new number is not already in use.

Please find the documentation with more details about this behaviour:

https://docs.servicenow.com/csh?topicname=knowledge-article-duplicate-numbers.html&version=latest

To enforce unique numbering, please find the guidance in the following documentation:

https://docs.servicenow.com/csh?topicname=c_EnforcingUniqueNumbering.html&version=latest

 

 

3) Refer KB:KB0564712 How to avoid duplicate Knowledge Base article numbers 

Resolution

Setting a high article start number


One way to avoid running into duplicate article numbers, is to set a high starting number for your articles, so to leave a gap for possible future data imports:

  1. In the Application Navigator, go to System Definition > Number Maintenance.

  2. Open the Knowledge (kb_knowledge) table.

  3. In the Controls tab or section, set the Number field to a high value, such as 10000, according to the expected quantity of records the safety gap should consist of.
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Tanushree Maiti
Tera Patron

Hi @Arpit1012 

 

Also check

Re-numbering duplicate KB article numbers while considering versioning

Servicenow documentation: Duplicate knowledge article numbers 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti