How to find the issue in Knowledge numbering table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 03:54 AM
Hi Team,
Kindly help me on below issue.
I am facing an issue in the knowledge table. In the prod instance, we set the knowledge number to 10206, but all the articles were created from 10000 and now the article number has been created up to 10197 after this article directly created 10206 article . how can we fix this issue?
Thanks,
Sasipriya.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 03:57 AM
Hi @sasipriya,
I'm not sure I get the issue?
Articles where created before you adjusted the number, after adjusting it, numbering went on from the new number. Seems like its doing what it should?
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 04:38 AM
@sasipriya You can write a fix script to fix the numbers of such articles. Here is one such sample script which could help you to update the existing numbers.
var kbArticle = new GlideRecord('kb_knowledge');
kbArticle.addEncodedQuery('numberBETWEENKB0010000@KB0010197');
kbArticle.query();
var kbNumber = 10206;
var count=1;
while(kbArticle.next()){
var someNum=kbNumber+count;
kbArticle.setValue('number','KB00'+someNum);
kbArticle.update();
count++;
}
Please make sure to run this script in a sandbox instance first, if everything works fine, run this script via a fix script on prod.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 05:10 AM
And keep in mind, KB Versioning might not like this 😉
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.