- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 04:15 AM
Hello Community,
We have an assignment group called "#### Computer-Vendor." This has an assignment rule: if a CI is an #### laptop, computer, or printer, the incident will be assigned to the #### computer-Vendor assignment group.
Group members are all from the third-party vendors staff.
I'd like to restrict the incident record so that the "#### Computer-Vendor" member of this group can only see the incident that has been assigned to the group and not other incidents. Currently, they can see every incident record in the table.
In ServiceNow, this group should only see incidents that have been assigned to "#### Computer-Vendor."
I know ACL can do it, but I'm stuck on the logic.
Can anyone help me with ACL logic or in any other way?
Thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 04:47 AM
You can write a before Query business rule to modify the query to add the following query
var isMember = gs.getUser().isMemberOf('#### Computer-Vendor');
if (isMember){
current.addQuery('assignment_group.name', '#### Computer-Vendor ');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 04:47 AM
You can write a before Query business rule to modify the query to add the following query
var isMember = gs.getUser().isMemberOf('#### Computer-Vendor');
if (isMember){
current.addQuery('assignment_group.name', '#### Computer-Vendor ');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 06:50 PM
Hi Suvro,
Can you please help me a bit here?
A few members of the group are also members of other assignment groups as well.
When I use these conditions, they are unable to view other incidents that have been assigned to their other assignment group.
I need conditions that check if a user is the only member of this group. then it should restrict the visibility.
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 04:53 AM
Hello,
You can write before query business rule like below
Condition
gs.getUser().isMemberOf('Name of group') && gs.getSession().isInteractive()
Code:
(function executeRule(current, previous) {
current.addQuery('assignment_group' , 'sys_id of assignment group you want them to see');
})(current, previous);
Screenshot
Mark my answer as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 06:50 PM
Hi Musab,
Can you please help me a bit here?
A few members of the group are also members of other assignment groups as well.
When I use these conditions, they are unable to view other incidents that have been assigned to their other assignment group.
I need conditions that check if a user is the only member of this group. then it should restrict the visibility.
Thanks