field should be display if logged in user have itil role only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 06:39 AM
I gave a requirement that, as you can see in screenshot, if logged in user has itil role then only assign to self field should display and in assignment group field only those group should be populate in which logged in user is present. For this I write a script include and now want to execute role requirement for that i try client script but fails. Please provide me a suggestion so that i can do that and script should not be conflicted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 07:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 07:13 AM
you can use onLoad client script and check logged in user role and show/hide the variable
OR
you can use Read roles on that variable in Permission tab
for the next requirement you can use advanced ref qualifier and use this to show only groups to which logged in user belongs
javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader