- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 04:37 PM
Hi,
I have 2 groups A and B.
The Incident that belongs to group A, should not be accessible/visible to users of group B for which I have created a query business.
Same way the users of group A should only have access to their Incidents and not any other groups tickets. How can we restrict this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 09:09 PM - edited 02-04-2024 09:11 PM
Hi @Jake Adams
In the same query BR you can add the condition:
if(gs.getUser().isMemberOf('<group A sys_id>')) {
current.addQuery('assignment_group', <group A sys_id> );
return;
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 07:01 PM
Hello @Jake Adams ,
Kindly create before query advanced business rule with below script.
if(gs.getUser().isMemberOf("group A name")
{
current.addQuery('assignment_group',group A sys_id)
}
Replace group A name with name of group A
Replace group A sys_id with sys_id of group A.
This business rule checks whether login user is member of group A or not. If he is member of group A then it allow to user to see only his group A assigned incidents.
If my response is useful, then kindly mark it as "Accept as Solution" and " Helpful."
This helps community and as well as
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 08:49 PM
Hi @Jake Adams
Please refer below support articles :
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0790987
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0748356
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 09:09 PM - edited 02-04-2024 09:11 PM
Hi @Jake Adams
In the same query BR you can add the condition:
if(gs.getUser().isMemberOf('<group A sys_id>')) {
current.addQuery('assignment_group', <group A sys_id> );
return;
}
Please mark this response as correct or helpful if it assisted you with your question.