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

Michael Fry1
Kilo Patron

Out of the box you need an ITIL role to open a change. It would be real easy if your technicians had an additional role so you could modify the existing condition (current.approval=='not requested' && gs.hasRole("itil")) to something like current.approval=='not requested' && (gs.hasRole("itil") || gs.hasRole('customerole')).


Michael - not sure that gets me any closer but maybe I'm reading that wrong.   A customer or other IT user can put in a Change Request either through the portal or through ServiceNow (with an ITIL role)... I don't really care either way.   Once in ServiceNow only ITIL users can interact with the CR.   If I assign an additional role I still have the same problem... I don't want the Request Approval button to be functional unless certain conditions are met on the form itself.   I'm not sure I see how an additional role will achieve this.


My condition was stated incorrectly. I meant to say: current.approval=='not requested' && gs.hasRole('customerole'). So the button would be hidden for itil users but for the technicians it would be visible. However, if you want it on form fields, that thought probably won't work.


pratulagarwal
Mega Expert

Hi Andy,



You can add conditions in the UI action,


current.field_name!="



But make sure to put this as an AND condition with the existing onditions.



Regards


Pratul Agarwal