Show incidents assigned only to a specific group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2024 11:18 PM
Hi.
I want to give users belonging to the XYZ group access to all requests and some incidents, but only to the group to which they belong. I added the roles sn_incident_read, sn_incident_write, sn_request_read, sn_request_write to the entire group, but I have to somehow limit the visibility to these specific group incidents.
ACL is not an option because developers do not get the admin_security role and I cannot create new ones.
I tried to create a BR, but after impersonating it as a user, I still have access to all incidents.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 12:23 AM
Even if I change it to Query, after impersonate the user still sees all the incidents..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 03:15 AM
Hi
Please add the below code in the query business rule and try again.
current.addEncodedQuery("assignment_groupISEMPTY^ORassignment_group!=group_sys_id");
Hope this helps you out in resolving the issue
Thanks & Regards,
Anitha H V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 03:45 AM - edited ‎04-08-2024 03:49 AM
Hello mate,
Your current code will restrict the incidents to users belonging to other group.
To show incidents assigned only to a specific group, please change the condition to
gs.getUser().isMemberOf('L3-DMS')
and your script to
(function executeRule(current, previous /*null when async*/) {
current.addEncodedQuery("assignment_group=<sys_id of L3-DMS>"); // go to the incident table add the query as per your requirement and paste the encoded query here. if you want users part of L2-DMS group to view incidents which are only assigned to this group then paste the sys_id of L2-DMS group here.
})(current, previous);
If my answer has helped with your question, please mark my answer as accepted solution and give a thumbs up.
Best regards,
Tharun Kumar