How to call SLA definition in business rule?

salu
Mega Guru

Hello all

I would like to call a SLA definition in business rule.I have created an SLA,based called title I need to trig err this SLA.How can we achieve it?else please help me with   some other solution

Below business rule am making to increase the priority.

var scsdCaller = current.caller_id.getRefRecord();

var scsdCallerTitle = scsdCaller.title;

var title=['ADMIN','PRO','VP','SVPO','DIR','SR DIR','EVP','CEO','President','CIO','Chairman'];

for(i=0;i<=title.length;i++)

  {

  if(scsdCallerTitle.indexOf(title[i])>=0|| criticalLoc.u_critical_loc == 'true')

  {

  setSCSDpriority();

  }

}

function setSCSDpriority() {

  current.impact = 1;

  current.urgency = 1;

  current.priority = 1;

 

}

SLA definition

find_real_file.png

Thanks

Saranya

1 ACCEPTED SOLUTION

oliverschmitt
ServiceNow Employee
ServiceNow Employee

Hi Saranya,



the 2011 SLA Engine can be found in the "TaskSLAController" Script Include. It is pretty heavy and I would not recommend to change it. As far as I see it you just need to move your "if(scsdCallerTitle.indexOf(title[i])>=0|| criticalLoc.u_critical_loc == 'true')" condition with all the titles into the SLA and it should work OOTB. Like that the SLA should simply get triggered when the condition matches and you configure rather than customize.


View solution in original post

3 REPLIES 3

oliverschmitt
ServiceNow Employee
ServiceNow Employee

Hi Saranya,



the 2011 SLA Engine can be found in the "TaskSLAController" Script Include. It is pretty heavy and I would not recommend to change it. As far as I see it you just need to move your "if(scsdCallerTitle.indexOf(title[i])>=0|| criticalLoc.u_critical_loc == 'true')" condition with all the titles into the SLA and it should work OOTB. Like that the SLA should simply get triggered when the condition matches and you configure rather than customize.


Hello Oliver,


Yes you are correct.


I made my condition inside the SLA definition and working as expected.But here my challenge is if my there are giving more titles my or condition will get increase.



find_real_file.png


oliverschmitt
ServiceNow Employee
ServiceNow Employee

Hi Saranya,



I totally agree. I guess if the titles increase you should see it as a new requirement and to fulfill it something needs to be changes. It is always difficult to maintain string conditions and in this case you at least have the chance to maintain it outside of a script, which should allow a quick change of the condition.