Expired articles are visible in global search
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Even after the knowledge article’s Valid To date has been passed, the article is still visible to all users in the global search(Native UI). The workflow state of this article is still published, and valid to date is passed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi there @seelamnandh
Please verify whether the scheduled job for expiring knowledge articles is running correctly, as the workflow state usually needs to change from Published to Expired/Retired for the article to be removed from search results. Also check search indexing, since stale indexed results can sometimes continue to appear until the index is refreshed.
Kind Regards,
Azar
Serivenow Rising Star ⭐
Developer @ KPMG.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Its_Azar , Thanks for the response. There is no scheduled job configured, so i have now configured a scheduled job to change the workflow state from published to outdated, once the valid to date has passed. But even me with knowledge_admin role, not able to see that particular article in global search. I am getting the below error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Once the article state changes from Published to Outdated, ServiceNow blocks access from Global Search (even for knowledge_admin). Outdated articles should be accessed from the Knowledge article list, not via Global Search.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @seelamnandh
This behavior is expected unless article expiry automation is configured.
The Valid To field alone does not automatically hide or retire a Knowledge Article from Global Search in Native UI. If the article is still:
- in Published state
- Active = true
- and indexed by search
then it can continue appearing in search results even after the Valid To date has passed.
Please verify the following:
- Check whether any Knowledge expiry/retirement scheduled job is active.
- Confirm whether a Knowledge lifecycle workflow/flow is configured to automatically retire expired articles.
- Rebuild or refresh the search index if the article was recently updated.
- If using AI Search or custom search sources, ensure expired articles are excluded using conditions like:
valid_toISEMPTY^ORvalid_to>=javascript:gs.nowDateTime()OOB, the valid_to field is mostly informational and does not automatically change the workflow state to Retired.
As a solution, you can create a Scheduled Script/Flow to retire expired articles automatically.
Scheduled Script:
var gr = new GlideRecord('kb_knowledge');
gr.addQuery('workflow_state', 'published');
gr.addQuery('valid_to', '<', gs.nowDateTime());
gr.query();
while (gr.next()) {
gr.workflow_state = 'retired';
gr.active = false;
gr.update();
}
After retirement, reindex Knowledge Search if the article still appears in Global Search.
****************************************************************************
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