ui policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11 hours ago
There is a scenario where in the incident table if the user does not belongs to service desk group then the assignment group field should be read only for that users. I tried using client script but not able to see the output and also i tried using ui policy . Can anyone explain how to acheive this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2m ago
Greetings @Segenenipri. If you wish to achieve this via some sort of client-side logic such as a Client Script or a UI Policy, I recommend utilizing a GlideAjax approach. You would be passing the current User value from your UI Policy or Client Script to a Script Include in order to perform the .isMemberOf method which is part of the GlideUser class. I will include a link to some documentation regarding GlideUser and the famous GlideAjax cheat sheet below.
However, this will require several lines of code between the client-side record, the server-side Script Include, a new function within the Script include, both the client and server side code will need to be checked for errors, the new Script Include will need sufficient permissions created, those permissions will need to be applied to the correct audience in order to take advantage of this logic.
Instead, I would recommend creating a new "write" ACL on the Assignment Group field for this table. In this new "write" ACL on the Assignment Group field, you can utilize the Advanced Condition field. I've included some JavaScript to get you started below in addition to some helpful information about ServiceNow Access Controls (ACL).
gs.getUser().isMemberOf("Service Desk Group");
Access Controls - The Easy Way - ServiceNow Community