- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:17 PM
Hello Everyone,
I would need a quick help and/or clarification, regarding a customer requirement that I have recently received.
We have around 200 KB articles which are in 'Review' state since more than 1 year.
Customer wants us to retire these KB articles.
But the UI action of Retire is only available for published articles, not for 'reviewed' articles'.
So, here is my question: is there any way to retire KB articles that are in review state?
Please let me know.
Please mark this post as a solution and also as helpful, if this resolves your issue or query.
Thanks,
Subhadeep Ghosh.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:23 PM
Hi @subhadeep1618 you can retire those articles through background script:
script:
var kb = new GlideRecord('kb_knowledge');
kb.addEncodedQuery('workflow_state=review');//filter by review
kb.query();
while(kb.next())
{
kb.workflow_state = 'retired';// set to retire
kb.update();
}
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:23 PM
Hi @subhadeep1618 you can retire those articles through background script:
script:
var kb = new GlideRecord('kb_knowledge');
kb.addEncodedQuery('workflow_state=review');//filter by review
kb.query();
while(kb.next())
{
kb.workflow_state = 'retired';// set to retire
kb.update();
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 12:39 AM
Thanks @Harish KM ,
Yes, I had also tried with same approach before posting this question - i.e., through back-end script, and it worked.
But is this a ServiceNow best practice?
Please mark this post as a solution and also as helpful, if this resolves your issue or query.
Thanks,
Subhadeep Ghosh.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 12:47 AM
Hi @subhadeep1618 when the article goes to review state, it will go through approval process, so approver can decide whether he needs to publish this article or he can set it back to draft /retired. That's the process, in your case I think background script should do since you want to mass update the records.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 12:51 AM
Thanks @Harish KM for your time.
Yes I think you're correct - scripting might be the only option in this case.
Please mark this post as a solution and also as helpful, if this resolves your issue or query.
Thanks,
Subhadeep Ghosh.