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
2 hours 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
2 hours ago
Hi @Kiran_25
Could you please check how this works? Out of the box (OOTB), I believe a change can only be closed when it is implemented; otherwise, it can only be canceled. Because of this, your logic may conflict with the standard OOTB behavior.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
I am working with Change Models and modifying it to fit business requirements. At the moment the Close UI button is visible at all states. If I remove ' !new ChangeRequestStateHandler(current).isOnHold() ' from the condition string then the button is no longer visible at any state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
So you want to close the change event while it is On Hold? I am against that approach, mate. You are following a wrong practice. A change should only be clsoed outside Implemented state, either before or after. Could you share the full details or code so we can review it properly?
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Out of the box (OOTB), the Close UI action is not available in the Implemented state. Therefore, your logic will not work as expected.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
