Show incidents assigned only to a specific group

New user1212
Tera Contributor

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?

Newuser1212_0-1712557004118.png

Newuser1212_1-1712557023499.png

 

7 REPLIES 7

Even if I change it to Query, after impersonate the user still sees all the incidents..

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

 

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