Override Priority on Incident

Brett14
Giga Expert

All,

My requirement is to override the priority field when the assignment group   = PeopleSoft.   This group only uses priority, but do to the priority lookup rules everytime they need to change the priority it gets re-calculated based on impact and urgency.   The client suggest that we override the priority just for this group.

In order to do this I created a onChange Client Script to grab the value of the Priority choice list into a string field

var var1 =g_form.getValue('priority');
g_form.setValue('u_priority_override',var1);

}

Now I would like to take that value from u_priority_override and re-insert back to the Priority field.   However, I am unable to get the onBefore Business Rule to fire.   I know this is easy, but I am not having any luck so I decided to ask the community.

setPriority();

function setPriority() {

  if (value == 1){

  current.priority = '1';

  }

  else if (value == 2){

  current.priority = '2';

  }

  else if (value == 3){

  current.priority = '3';

  }

  else if (value == 4){

  current.priority = '4';

  }

  else if (value == 5){

  current.priority = '5';

  }

}

1 ACCEPTED SOLUTION

All,



This is a late reply but I was able to resolve my issue.   I have pasted my business rule below for reference to anyone else.



Table: Incident


When: Before update


Order: 10,000


Script:



setPriority();


function setPriority() {


  var po = current.u_priority_override.getDisplayValue();//custom field that holds the value of the Priority


  if (po == "1 - Critical"){


  current.priority = 1;


  //gs.log('PO = ' + po);


  }


  else if (po == "2 - High"){


  current.priority = 2;


  //gs.log('PO = ' + po);


  }


  else if (po == "3 - Moderate"){


  current.priority = 3;


  //gs.log('PO = ' + po);


  }


  else if (po == "4 - Low"){


  current.priority = 4;


  //gs.log('PO = ' + po);


  }


  else if (po == "5 - Very Low"){


  current.priority = 5;


  //gs.log('PO = ' + po);


  }


}


View solution in original post

3 REPLIES 3

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Hi Brett,



Maybe this thread helps you:



Disable P1 from certain applications



Regards,


Sergiu


Hi Sergiu,



I have looked at this thread and my client doesn't want to change the priority lookup (wants to keep what is OOB).   They only want to override the calculation.   Meaning when PeopleSoft group change Priority to 1 - Critical it should stay at P1 and not re-calculate based on impact and urgency.


All,



This is a late reply but I was able to resolve my issue.   I have pasted my business rule below for reference to anyone else.



Table: Incident


When: Before update


Order: 10,000


Script:



setPriority();


function setPriority() {


  var po = current.u_priority_override.getDisplayValue();//custom field that holds the value of the Priority


  if (po == "1 - Critical"){


  current.priority = 1;


  //gs.log('PO = ' + po);


  }


  else if (po == "2 - High"){


  current.priority = 2;


  //gs.log('PO = ' + po);


  }


  else if (po == "3 - Moderate"){


  current.priority = 3;


  //gs.log('PO = ' + po);


  }


  else if (po == "4 - Low"){


  current.priority = 4;


  //gs.log('PO = ' + po);


  }


  else if (po == "5 - Very Low"){


  current.priority = 5;


  //gs.log('PO = ' + po);


  }


}