- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2025 09:20 PM
I have a requirement that user can see incidents for which he/she is Caller.Assigned_to , part of watchlist or part of a particular assignment group. Please help me with complete scenario.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2025 09:28 PM
Hello @bhavyabansa ,
You can use Before Query BR for the same.
Try using this script
Please mark my answer correct and helpful if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2025 09:28 PM
Hello @bhavyabansa ,
You can use Before Query BR for the same.
Try using this script
Please mark my answer correct and helpful if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2025 09:34 PM
there is already OOB Query BR on incident table which does the caller, assigned to and watch list logic
You can enhance it for assignment group
Code in bold is enhanced one
Remember you will have to update table.None READ ACL as well
ACL - update this OOB ACL
https://instanceName.service-now.com/nav_to.do?uri=sys_security_acl.do?sys_id=7da3bda1c0a801667dc88c1e9527f776
var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
current.opened_by == gs.getUserID() || current.caller_id == gs.getUserID() || current.watch_list.indexOf(gs.getUserID()) > -1 || groups.indexOf(current.assignment_group.toString()) > -1;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2025 09:49 PM
Existing BR which Ankur mentioned can be utilized but if you are looking for particular group person can view it then store sys_id of those group in comma separated under system properties and call it in code provided by Ankur.
In BR to call property syntax is as below:
gs.getProperty('yourPropertyName')
so last line where the query is return will be like
current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u).addOrCondition('assignment_group.sys_id', 'IN', gs.getProperty('YourPropertyName'));
As well same in ACL can be done if you want specific group to be checked
current.opened_by == gs.getUserID() || current.caller_id == gs.getUserID() || current.watch_list.indexOf(gs.getUserID()) > -1 || groups.indexOf(gs.getProperty('yourPropertyName')) > -1;
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.