Restrict users to see only their assignment group incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2026 04:47 AM
Hello
We have a requirement
1. Logged in User should only see incidents assigned in their assignment group
2.If the user is searching for any incident ticket(ticket is assigned in group which user does not belong to) they should see only Number & Assignment Group fields.
How can we achieve this?
Thanks
Krutika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2026 05:00 AM
Few more links
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/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2026 05:06 AM
Please check these 2 links.
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/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2026 05:56 AM
Hi @Krutika Valanj2 ,
Please check the solution below that may help you.
- Navigate to System Definition > Business Rules and create a New rule.
- Name: Restrict Incident Visibility by Group.
- Table: Incident [incident].
- When: Before.
- Query: Checked.
- Advanced Script :
(function executeRule(current, previous /*null when async*/) {
if (gs.hasRole('admin') || !gs.getSession().isInteractive()) {
return;
}
// Get the logged-in user's groups
var myGroups = gs.getUser().getMyGroups();
current.addQuery('assignment_group', 'IN', myGroups);
})(current, previous); - Step 2: Restrict Field Access for Search Results (ACLs)A Query Business Rule only filters lists. If a user searches for a specific incident number and finds it via Global Search, they might still bypass the rule. To restrict everything except "Number" and "Assignment Group," you must use field-level ACLs.
- Create a Table-Level Read ACL:
- Type: record.
- Operation: read.
- Name: incident.
- Script: answer = true; (This allows general access to the record so it can be found in search).
- Create a Field-Level Read ACL (Restricting all fields):
- Type: record.
- Operation: read.
- Name: incident.* (The asterisk targets all fields).
Script:
var myGroups = gs.getUser().getMyGroups();
answer = myGroups.indexOf(current.assignment_group.toString()) != -1;
- Create Field-Level Read ACLs for Exceptions:
- Create two separate ACLs for the Number and Assignment Group fields.
- Name: incident.number and incident.assignment_group.
- Script: answer = true; (This ensures these two fields are always visible even if the * ACL fails).
- Create a Table-Level Read ACL:
- If you feel this answer helpful for you please mark it as helpful.
Regards,
Sagnic
