How do I limit the visibility of incidents on a particlular business service to a specific group

June Unwin
Tera Contributor

I am onboarding a new team and their requirements are for all their incidents to be visible only to their team and nobody else.  I have set up routing based on business service to their team, but am not sure how to achieve the security aspect of this.  I've not used a Before query business rule and no clue on scripting so all help would be gratefully accepted.

12 REPLIES 12

Hello June,

*Update

Remove the condition from When to run tab 

 

if(!(gs.getUser().isMemberOf('Service Desk'))){

//query = 'field_name!= sys_id';

 var query = 'cmdb_ci!="22222_sys_id";

 current.addEncodedQuery(query);

}

I tried above script and it worked for me.

Hello June,

*Update

Remove the condition from When to run tab 

 

if(!(gs.getUser().isMemberOf('Service Desk'))){

//query = 'field_name!= sys_id';

 var query = 'cmdb_ci!=entersys_id';

 current.addEncodedQuery(query);

}

I tried above script and it worked for me.

Ankur Bawiskar
Tera Patron
Tera Patron

@June Unwin 

out of the box already incident table has a query BR

did you check that and try to enhance it based on your requirement?

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

I have tried to use it but am struggling to know how to script the condition that would limit access based on service and assignment group

@June Unwin 

Please share what did you try so far.

Out of the box there is already a restriction based on caller, watch list user etc

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