Restriction of Incident tickets

Jake Adams
Tera Contributor

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?

1 ACCEPTED SOLUTION

Ayushi12
Mega Sage

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.

 

View solution in original post

3 REPLIES 3

siva krishna M2
Tera Guru

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

Amit Verma
Kilo Patron
Kilo Patron

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.

Ayushi12
Mega Sage

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.