Assigning high priority for "Emergency change request" by default.

sifynm
Tera Expert

How do we make all Emergency change risks to be in high priority by default when the option "Change Request > Emergency: Unplanned changes necessary to restore service. These changes require CAB authorization only." is clicked.

1 ACCEPTED SOLUTION

okay.



Step 1. you need to edit the change module as mentioned step 1 above.


Regards
Harish

View solution in original post

37 REPLIES 37

That's fine. Now you can write onchange client script on field 'Type' which I gave u before.When you change the type to Emergency values should be set.


function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {


          return;


    }


  var chg = g_form.getValue('type');


  alert(chg);


  if(chg=='emergency')


  {


  alert('inside');


  g_form.setValue('priority', 1);


  g_form.setValue('risk',1);


  g_form.setValue('impact',1);



  }


    }


Regards
Harish

Harish,


                We are now in a common view that on click on create new we are landing in a page Change > Create New page and there is no change.  


Now as you can see in my postings I don't have an option to choose a specific Change request as the type field is grayed out where as for you it is available. Could you kindly let me know the reason for it (I did an upgrade of my instance from Helsiniki to Istanbul. Not sure if this is the cause.)? The below mentioned are the fields that I observe a change between yours and mine.



Affected CI


Approval


Type: Normal (You have option to change, I don't.)


This tag is closed but I have a code which is as mentioned below which I have included in emergency change request in the "Change Request" and Intercepts: change_request.do. Please let me know if there are any changes required.



function onLoad() {



function disable() {


      document.getElementById("priority").disabled = true;


      document.getElementById("impact").disabled = true;


      document.getElementById("risk").disabled = true;


      }



<form>


<select id="priority">


  <option>1</option>


</select>


<select id="impact">


  <option>1</option>


</select>


<select id="risk">


  <option>1</option>


</select>


</form>



<script>


disable()


</script>


}


Dave Smith1
ServiceNow Employee
ServiceNow Employee

This is probably a job for a business rule (on insert/update) or a UI Policy that sets the priority based on change category.


Dear Mr.David Smith,


                  I am not sure at the moment on business rules and have not changed anything. I am trying to just follow what Mr. Harish kumar has posted and which has worked for him. I am trying to find out why it is not working for me. Please request you to be more specific on which business rule needs to be modified. I am just a recent developer who is working on ServiceNow. Kindly help me to achieve this "Assigning high priority for "Emergency change request" by default."