- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 12:55 AM
you can use ACL
IN ACL Script : if(gs.getuser().isMemberOf('current.assignment_group'){ answer=ture; }else{ answer=false }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 12:37 AM
Hi @vidishaagarwal5 ,
you have create a ACL , please find the step by step process for that -
1. Create or Modify an Access Control Rule
- Navigate to System Security > Access Control (ACL).
- Create a new ACL or modify an existing one for the Incident table.
- Set the Type to record.
- Set the Operation to read.
2. Set the Condition or Script
You have two options:
Option A: Condition-Based ACL
Use a condition like:
Assignment Group is one of javascript:getMyGroups()NOTE -Where getMyGroups() is a custom function or dynamic filter option that returns the groups the current user belongs to.
Option B: Script-Based ACL
Use a script like this:
var userGroups = gs.getUser().getMyGroups();
var incidentGroup = current.assignment_group;
if (incidentGroup == null) {
answer = false;
} else {
answer = userGroups.indexOf(incidentGroup.sys_id.toString()) != -1;
}
This script checks if the current user's groups include the assignment group of the incident.
Please nark as complete and close the thread if this is helpful.
Thanks,
Rithika.ch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 12:38 AM
Hi @vidishaagarwal5 ,
You need to write Query Business rule like below-
and in advanced tab need to write script logic-
Here is the code-
var userGroups = [];
var grMember = new GlideRecord('sys_user_grmember');
grMember.addQuery('user', gs.getUserID());
grMember.query();
while (grMember.next()) {
userGroups.push(grMember.group.toString());
}
// Restrict query to only incidents assigned to those groups
if (userGroups.length > 0) {
current.addQuery('assignment_group', 'IN', userGroups);
} else {
// If user is not in any group, show nothing
current.addQuery('sys_id', 'EMPTY');
}
Please test this code I have tested in PDI it's working fine.
If you found my response helpful, please mark it as helpful and accept it as the solution.
Thank you
Nawal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 12:55 AM
you can use ACL
IN ACL Script : if(gs.getuser().isMemberOf('current.assignment_group'){ answer=ture; }else{ answer=false }