How to restrict visibility of UI Action button on Change Req form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Currently on the change request form there is Close UI action button is visible at the top of the page. I need to change this so that it is only visible when state = Implement OR Review.
Below is UI Action condition which is not working:
gs.hasRole('itil,sn_change_write') && !new ChangeRequestStateHandler(current).isOnHold() && (new ChangeRequestStateHandler(current).isState("review") || new ChangeRequestStateHandler(current).isState("implement"))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
isState() method is not available in that script include.
Simply update the condition as this
gs.hasRole('itil,sn_change_write') && !new ChangeRequestStateHandler(current).isOnHold() && (current.state == -1 || current.state == 0)
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
