- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 04:46 AM
Hi,
knowledge article in system has passed the valid to date but workflow is still showing published. Ideally it should move to Retire but it is not happening. There is no way to check workflow execution for that kb article. Please let me know if anyone knows why is this happening. PFB screenshot for reference.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 05:09 AM - edited ‎01-05-2024 05:10 AM
Hi @Sarabjeet1,
Here's a script you can use in a Scheduled Job.
Please mark correct and helpful.
Thanks,
Robbie
var retireKB = new GlideRecord('kb_knowledge');
retireKB.addEncodedQuery("workflow_state=published^retired<javascript:gs.daysAgoStart(0)"); //change 0 to the number of days ago
retireKB.query();
while(retireKB.next()) {
retireKB.workflow_state ='retired';
retireKB.active=false;
retireKB.update();
retireKB.log('Knowledge article retired' +retireKB.number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 05:04 AM
Hi @Sarabjeet1,
There's a similar question and conversation regarding this topic in the link below.
A quick FYI for context: When a knowledge article expires articles do not appear when browsing or searching after the valid-to-date, or if the valid-to-date is empty.
The thought process behind this from a document control perspective is the control and management of documents/articles is the Knowledge team(s) would want to take that opportunity to review the "expired" articles, where they can be unpublished, extended, revised or deprecated in favour of another article.
There's email notifications that manage this for you - see here: https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/knowledge-management/conce...
Similar thread: https://www.servicenow.com/community/itsm-forum/for-knowledge-articles-what-will-happen-after-the-va....
To help others, please mark correct and helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 05:38 AM
Hi @Sarabjeet1
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************