Retired Knowledge articles in Global search
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 03:53 AM
Hi,
can anyone help me, how can I make the retired knowledge articles not to be visible in Global search.
Actually service desk users are able to view retired knowledge articles by entering the number in global search.
can anyone please provide me the solution.
I have tried creating READ ACL on kb_knowledge table, but no use.
Thank you.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 02:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 03:19 AM
Does it show them when you get a list or only when you write the KB number and get redirected directly to the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 02:57 AM
Hi Goran,
When I enter the KB number in Global search, then it is displaying the knowledge article.
It is directly getting retired Knowledge article.
please suggest me regarding this issue.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 11:05 AM
I would say that you need to edit this ACL:
https://YOUR_INSTANCE.service-now.com/sys_security_acl.do?sys_id=65bbd9bcd71221004792a1737e610389
Here you need change the script part to check if the state is retired and then just return true if the user is an admin.
Something like:
if (current.isNewRecord())
answer = true;
else if (current.workflow_state = 'retired' && !gs.hasRole('admin'))
answer = false;
else if (current.isValidRecord())
answer = new KBKnowledge().canRead(current);
else if(!gs.nil(current.sys_id)){
var gr1 = new GlideRecord("kb_knowledge");
gr1.addQuery("sys_id", current.sys_id);
gr1.query();
gr1.next();
answer = new KBKnowledge().canRead(gr1);
}else
answer = false;
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 03:20 AM
Hi Goran,
Thanks for the script, I have made changes to the ACL script as you suggested,
it works perfect and I am unable to find any retired knowledge article using global search. But here problem is no retired KB articles are visible by application navigator as well.
Requirement is to stop only at Global level, but not at application navigator as attached in screenshot.
Please suggest and help me to achieve this requirement.
Thank you.