How to restrict specific group incidents to only its group members and the creator

Sowmya20
Tera Contributor

Hi,

 

Restrict specific group incidents to only its group members and the creator to search/read the incident.

 

I'm trying below ACL to restrict but not working

Condition:

Assignment group is "Restricted group name"

Script:

gs.getUser().isMemberOf('811b20e21b72e700755b8480cd4bcb4a');

 

Please help.

 

Thanks,

Sowmya

 

 

 

 

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@Sowmya20 

remember you need to ensure the OOB query business rule on incident table is also updated to handled this use-case

update the query BR in addition to your above ACL

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Thank you for replying

 

Please find below Business Rule.

Table: incident

Filter Condition: assignment is "restricted group name"

Condition: !gs.getUser().isMemberOf('restricted group name') 

Script: 

(function executeRule(current, previous /*null when async*/ ) {
var grp = current.addNullQuery('assignment_group').addOrCondition('assignment_group','!=','811b20e21b72e700755b8480cd4bcb4a');
})(current, previous);

 

Before Query

 

 

and ACL

if(gs.getUser().isMemberOf('811b20e21b72e700755b8480cd4bcb4a'))
{
answer=true;
}
answer=false;

Test:

I have impersonated other than this Assignment group able view the ticket.

 

 

Meena4
Tera Contributor

@Sowmya20 

 

Did you get any solution?

 

Meena4
Tera Contributor

@Sowmya20 

Is it working fine now?