- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:12 PM
In the incident table, I have a group field
Users of group1 can only see and edit the records of group1
Users of group2 can only see and edit the records of group2
I want to achieve such permission control
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 04:00 AM
Hi,
so since you are having u_group field as reference on your table
you can use this and it would show only those records where logged in user is member of u_group
var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
current.addQuery('u_group', 'IN', group.toString());
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:15 PM
Hi,
You can use Query BR on Incident table
OR
Read, Write ACL on Incident table
Did you try something? If so, kindly share.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:24 PM
Hi,
I would suggest to use Query business rule on your table so that only restricted records are seen by the users.
what did you start with and where are you stuck?
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:25 PM
You will need to set up query BR to achieve this.
You can modify OOB incident BR.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 02:09 AM
Thank you very much. I tried to use the query business rule
current.addQuery('u_group','MyGroup's sys_id');
After using such a query, I fixed the records of a group
How to determine whether the current query user is in the group
How to add such a expression in ServiceNow query
select * from table where(gs.getUser().isMemberOf(select group from table))