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

found a typo,

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 ,
this one also not working 

Vani14_0-1689864588895.pngVani14_1-1689864633855.png

 

 

 

 

Ok its because of the case, 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().toLowerCase().indexOf('informational standard change') >-1))
-Anurag

@Anurag Tripathi  Thank you. Its working

Glad to hear, Can you mark my response Correct/helpful and close the thread?

-Anurag