Restrict the users in list view

Basha4
Tera Expert

Based on the role(maybe ITIL or itil_admin or any role), Restrict the user in the list view(show only active incidents or critical incidents or Only new incidents)

3 REPLIES 3

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Basha4 

 

You can achieve it using Query Business Rule on Incident.

 

In your EncodedQuery you can add these Conditions of Critical, Active and New.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Please write a code for this one

Jerick I
Kilo Sage
Kilo Sage

Hi @Basha4,

 

You can use the below sample code on your BR query.

JerickInovero_0-1669008539708.png

 

if(gs.hasRole('admin') == true){
current.addEncodedQuery('active=true^priority=1');
}

JerickInovero_1-1669008561835.png

You may also refer on this community post Before query business rules example?

 

I hope this helps.

Please mark the response as helpful if this helps and Accept if this solves your issue.

Regards,

Jeff