HRSD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 08:52 PM
Knowledge author i want to hide all the non-HR can & cannot read criteria from the HR knowledge bases(HR all employees & HR-Agents).
Below process i create but not working as per the above requirement. any one idea help me
Go to Knowledge > Administration > Knowledge Bases.
Open the HR knowledge base.
Under Can Read / Cannot Read, ensure only relevant HR criteria are listed.
Remove any user criteria not related to HR.
2.Create Separate HR-Specific User Criteria
Create user criteria that target only HR users:
Go to Knowledge > Administration > User Criteria.
Create user criteria like HR Only, with conditions based on roles (hasRole: hr_user or equivalent).
Use these for Can Read / Cannot Read settings.
3.Restrict Author Visibility in Knowledge Author UI
If you're using the Knowledge Author customize the visibility of criteria:
Option A: Use ACLs
Create Access Control Rules (sys_user_criteria) that restrict visibility of user criteria based on roles (e.g., only HR authors can see HR-related criteria).
Client Scripts
If authors use a form to select criteria:
Client Script on the Knowledge Article form to hide non-HR criteria when the knowledge base is HR-related.
if (g_form.getValue('kb_knowledge_base') == 'HR - All Employees' || g_form.getValue('kb_knowledge_base') == 'HR - Agents') {
g_form.setDisplay('non_hr_user_criteria_field', false);
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2025 08:14 PM
Hello @P1234 ,
-
Create new criteria:Go to Knowledge > Administration > User Criteria and create new criteria that specifically target HR users (e.g., HR Only, HR Agents, etc.).
-
Define conditions:Based on roles or other relevant attributes, define the conditions for these criteria (e.g.,
hasRole: hr_user
). -
Mark as HR criteria:If using the "HR Criteria" field, ensure these criteria are marked as "HR Criteria".
-
Create ACLs:Go to System Administration > Access Control and create Access Control Rules for the
sys_user_criteria
table. -
Restrict visibility:Set up ACLs that allow only users with HR roles (e.g.,
hr_admin
,hr_user
) to see the HR-specific user criteria, while hiding them from others.
-
Use a client script:On the Knowledge Article form, add a client script to hide non-HR user criteria when the knowledge base is HR-related.
-
Implement script logic:This script will check the selected knowledge base and, if it's an HR knowledge base, hide the non-HR criteria from the "Can Read" and "Cannot Read" fields.
function hideNonHRCriteria() {
if (g_form.getValue('kb_knowledge_base') == '<HR_KNOWLEDGE_BASE_SYS_ID>') { // Replace with your HR KB SYS_ID
g_form.setDisplay('user_criteria', false); // Assuming 'user_criteria' is the field for Can Read/Cannot Read
}
}
If it is helpful, please mark it as helpful and accept the correct solution by refer to this solution it will helpful to them.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2025 12:07 AM
Hi Abbas,
Can you please attach the Screenshots for reference.
New to learn HRSD & ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 07:43 PM