logged in user roles in UI policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 12:41 PM
I have to check If the logged in person is different than approver in an UI policy, how can I achieve this ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 12:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 02:15 PM
Perfect Chuck. Thanks, can I also logged in person has change_manager role also as a part of UI policy?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 02:19 PM
For that you would need to go to a client script. The condition might look something like this:
if (g_user.hasRole('change_manager'))
// do some more stuff
To translate the UI policy condition in to a client script
if (g_form.getValue('caller_id') == g_user.userID)
// do some stuff
Reference:
GlideUser (g user) - ServiceNow Wiki
GlideForm (g form) - ServiceNow Wiki and for good measure to keep you from hurting yourself...
Client Script Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 02:23 PM
Yeah I understand that it could be addresses using a client script, but my problem is as UI policy executes after client script, what ever mandatory client script sets, they are wiped by another Ui policy's false condition, so I am trying to make it a part of the that UI policy.