- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
you can use ACL
IN ACL Script : if(gs.getuser().isMemberOf('current.assignment_group'){ answer=ture; }else{ answer=false }
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
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
Tuesday
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
Tuesday
you can use ACL
IN ACL Script : if(gs.getuser().isMemberOf('current.assignment_group'){ answer=ture; }else{ answer=false }
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
