Creating user group with restricted access to Incidents

Sarva
Tera Contributor

I need to create a group of users with restricted access to Incidents. These users should be able to see only tickets assigned to their groups and not able to see any other incidents created in SN. 

 

I tried to replicate the following in Test environment, but its not working. 

1. Create 4 test users

2. Added these test users to a group.

3. Created a Business Rule (See below image) on Incident table.

 

Sarva_0-1672946054201.png

 

 

I'm trying to simulate it, but for some reason these test users are able to see other incidents also. 

Can someone please help me on this and also point out what's missing or what step am I doing wrong. Thanks!

1 ACCEPTED SOLUTION

Mike_R
Kilo Patron
Kilo Patron

This should work

Condition: gs.getUser().isMemberOf("YourGroupNameHere")

Script:

(function executeRule(current, previous /*null when async*/ ) {

current.addEncodedQuery('assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744');

})(current, previous);

 

Mike_R_0-1672953562503.png

 

 

View solution in original post

3 REPLIES 3

Mike_R
Kilo Patron
Kilo Patron

This should work

Condition: gs.getUser().isMemberOf("YourGroupNameHere")

Script:

(function executeRule(current, previous /*null when async*/ ) {

current.addEncodedQuery('assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744');

})(current, previous);

 

Mike_R_0-1672953562503.png

 

 

Txilos
Tera Contributor

Hi, Mike. 

I am currently looking in to this exact functionality, but when impersonating a group member I still can see all the incidents. 

I have assigned to the group the sn_incident_write role.

Any suggestions on what I'm doing wrong?  Thank you 🙂 

 

Sarva
Tera Contributor

Thank you so much @Mike_R , it worked 🙂