Ui action Visibility for the logged in user is Member RITM associated sc task assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 07:09 AM
Hi,
I have created the UI action called "Acknowledge" on RITM table. now i want to make it this UI action available for only if logged In User is member of the RITM associated SC Task assignment group. I have tried by using below UI action Conditions, but it is not working as expected. Please let me know, how to archive this by using UI action condition.
gs.getUser().isMemberOf(current.sc_task.assignment_group.getDisplayValue())
gs.getUser().isMemberOf(current.assignment_group.toString())
Thanks & Regards.
Rajesh B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 07:36 AM
You cannot dot-walk from the RITM to the SCTASK because there is no reference field on [sc_req_item] table referencing [sc_task] table. Moreover, a RITM can have multiple SCTASKs. You need to write a function that would make a GlideRecord table against [sc_task] table, find the appropriate SCTASK record there and fetch its Assignment Group. Put that function into a Script Include and call it from the UI action condition.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 07:44 AM
Thanks @Slava Savitsky,
Could you please provide reference script for this? I didn't face this kind of requirement earlier. If you could you provide the script it will be more helpfull.
Thanks,
Rajesh B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 09:55 AM
I am afraid I don't have a reference script for this. In fact, with the guidelines I provided earlier, you should be able to implement the solution yourself. If you are not familiar with script includes, here is what you can do:
- Check out product documentation: Script includes
- Have a look at scripts from the base system. For example, conditions in "Refresh Impacted Services" UI action for [incident] table uses a function from "CIUtils" script include.
- Take a ServiceNow scripting course on Now Learning
Give it a try and if you have further questions, feel free to ask them here.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/