- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 10:29 PM
Hi Everyone,
I would like to make UI Policy Action work only for users with specific roles.
I have two roles (Role A, Role B).
I want to set mandatory filed when user having Role B assigns the assignto of incident to a user who has RoleB.
However, when user having RoleA assigns the assignto of incident to a user who has RoleB, I do not want to set mandatory items.
Is it possible to realize by using a script?
Do you have better solutions?
thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2017 08:12 PM
If you want the UI Policy to be applied for different view then you can just uncheck the Global check box on your UI Policy and then select the view for which you want the UI Policy to be applied.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 10:35 PM
you can do it through display business rule + onLoad() client script to get the assigned to user value.
then use hasRole('role name') to check if it has this role then make field mandatory .g_form.setMandatory('<field name>',true);
https://www.servicenowguru.com/scripting/user-object-cheat-sheet/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 11:11 PM
you can also achieve it through ui policy.
Hope it will help you.
do dot waling in condition.
http://wiki.servicenow.com/index.php?title=Dot-Walking#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2017 12:33 AM
Remember that ui policies needs the fields to be able to evaluate the conditions... At least last time I checked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2017 07:04 PM
Hi harsh,
Thank you for your reply.
I not want to set mandatory,when "assigned to.Roles" is ITIL and login user not has ITIL.
I wolud like to know how to setting UI Policy.
I am using a different view for users who have ITIL roles or who do not have ITIL roles.
thanks.