How do I limit the visibility of incidents on a particlular business service to a specific group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 01:35 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 04:58 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 04:59 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 01:49 AM
out of the box already incident table has a query BR
did you check that and try to enhance it based on your requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 02:01 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 02:22 AM
Please share what did you try so far.
Out of the box there is already a restriction based on caller, watch list user etc
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader