Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to restrict visibility of UI Action button on Change Req form?

Kiran_25
Tera Expert

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"))

6 REPLIES 6

Ankur Bawiskar
Tera Patron

@Kiran_25 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Kiran_25 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader