- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 10:23 PM
i have a requirement to display only those incidents on which logged in user belongs to group.
example, if i belongs to x,y,z group then i should see only incident which has group x,y,z.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 10:27 PM
Hi @MK-p ,
You can create display query business rule and below query.
current.addEncodedQuery('assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744')
This query help you to display on of your group.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2025 01:09 AM
Thank you for marking my response as helpful.
Are you planning to remove the existing incident query BR and create a new one?
I believe I also provided you the correct approach by modifying existing OOB Query BR on incident table.
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well 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-08-2025 10:27 PM
Hi @MK-p ,
You can create display query business rule and below query.
current.addEncodedQuery('assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744')
This query help you to display on of your group.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 10:28 PM - edited ‎01-08-2025 10:28 PM
Use ACLs
Create table level read ACL for incident.
Apply conditions
Assignment Group (is)(dynamic) One of my Groups
Thats it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2025 10:54 PM
Remember OOB there is already a Query BR on incident table
Why not enhance that? Also you will have to check and update the condition in table level READ ACL
Line 24 is newly added
restrictIncidents();
function restrictIncidents() {
if (!gs.hasRole("itil") && !gs.hasRole("sn_incident_read") && gs.isInteractive()) {
//Do NOT restrict Incidents if SPM premium plugin is active AND user has the service_viewer role.
if (GlidePluginManager.isActive('com.snc.spm') && gs.hasRole('service_viewer'))
return;
if (GlidePluginManager.isActive('sn_fsm_itsm_mng') && gs.hasRole('wm_ext_agent'))
return;
// STRY52118544: ham_user is added to support incident read for reporting on HAM store app
if (GlidePluginManager.isActive('com.sn_hamp') && gs.hasRole('sn_hamp.ham_user')) {
return;
}
// DEF0330091: Allow query on OT Incident with sn_ot_incident_read role
if (GlidePluginManager.isActive('com.sn_ot_inc_mgmt') && gs.hasRole("sn_ot_incident_read"))
return;
// Responders should be able to access all incidents
if (gs.hasRole("sn_sow_srm.srm_responder")) {
return;
}
var u = gs.getUserID();
var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
current.addQuery('assignment_group.sys_id', 'IN', groups.toString());
current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);
}
}
ACL to be updated with below condition: https://instanceName.service-now.com/nav_to.do?uri=sys_security_acl.do?sys_id=7da3bda1c0a801667dc88c1e9527f776
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-09-2025 01:09 AM
Thank you for marking my response as helpful.
Are you planning to remove the existing incident query BR and create a new one?
I believe I also provided you the correct approach by modifying existing OOB Query BR on incident table.
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader