How to modify the "Request Approval" button

aharper00
Kilo Explorer

First time poster, this could be in the wrong place.

I am modifying the Change Management form prior to implementing with the business and am trying to get some functionality to work a bit different than OoB.   Today the Change form has two buttons... a Submit button and a Request Approval Button.   No fields are mandatory.   If an end user (or other IT user) needs a change performed they simply fill out the Change Request form with sometimes very little information... "I need the XYZ environment to scale horizontally by an additional 50% to handle additional load from the business."   The user should have only one option at this point... Submit.   Today the user can also hit the Request Approval button at this stage which is what I want to avoid.   It's entirely possible (and likely) that the person making the request won't know what the Change/Backout/Test Plans are or won't know when the Planned Start/End Times are.   With that, I don't want them to press the Request Approval button without those fields complete.  

It is important not to simply make those fields mandatory because they are then required for the Submit button as well.   If a technician is working on an incident and needs to create a Change Request to implement something to resolve the incident then that tech will have all of the needed information and should be able to skip the Submit button and go right to the Request Approval button.   I say this because I don't simply want to remove the button from the field if possible but am open to the idea of it being gone until all fields are filled out if that's the only answer.  

So what I think I'm looking for is a way to modify the Request Approval button so that it requires specific fields to not be empty.   If those fields are filled out then everything works as expected and the CR moves out for approvals.   If those fields aren't filled out then an error is presented to the user telling them what all fields are still required (or worst case just telling them that the form is not complete).  

How do I modify the form with these requirements??

Thanks!

Andy

7 REPLIES 7

Pratul - do you have any more info on that?   I tried heading down that path and didn't get where I wanted to go.   For instance, if I change the UI Action for Request_Approval to the following condition I lose the Request Approval button altogether on the form.   Even if after I submit/save a change with the change_plan filled out I still don't get the button back.   While not exactly optimal this would certainly work if only I can get it to work.



current.approval=='not requested' && gs.hasRole("itil") && current.change_plan!=''


Andy,



Does the field "change_plan" has any value after the change is submitted ?



Can you verify that other conditions are met, I do not see any reason why the UI action should disappear altogether.


robjohnwilson
ServiceNow Employee
ServiceNow Employee

Andy,


I think this thread should help you,


https://community.servicenow.com/thread/167613