Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to hide Request approval button for particular change request

Vani14
Tera Contributor

we have created standard change we need to hide request approval button only for that change request. i have tried using script in UI policy but its not working. 

 

 

Vani14_0-1689678101985.png

 

 

Vani14_1-1689678138051.png

 

19 REPLIES 19

Vani14_0-1689858736000.png

 

Vani14_1-1689858771511.png

 

Paste your condition also here, i'll edit and and give back.

-Anurag

@Anurag Tripathi ,

gs.hasRole('itil,sn_change_write') &&( new ChangeFormUI(current).isAuthorizeAvailable() || (current.type == 'standard' && current.state=='-5') || (current.type =='standard' && current.short_description.toString().IndexOf('informational standard change') >-1))

Hey

 

Try this

gs.hasRole('itil,sn_change_write') &&( new ChangeFormUI(current).isAuthorizeAvailable() || (current.type == 'standard' && current.state=='-5') && !(current.type =='standard' && current.short_description.toString().IndexOf('informational standard change') >-1))

 

-Anurag

@Anurag Tripathi ,
I tried this but its not working

 

 gs.hasRole('itil,sn_change_write') &&( new ChangeFormUI(current).isAuthorizeAvailable() || (current.type == 'standard' && current.state=='-5') && !(current.type =='standard' && current.short_description.toString().IndexOf('informational standard change') >-1))