SLA how to require an SLA be added to an incident

DeniseMelancon
Tera Contributor

Hi

I have a response SLA definition that is added when an Incident is in NEW state and is closed when not in New state.  The problem is that if you create the incident with an "Assigned to" person it is going straight to In Progress.  When this happens the response SLA does not get added to the incident.  How can I get a response SLA created with either 0 time or 1 second when this scenario occurs?  I want these incidents to be included in my metric of average time to respond to incidents.

 

Thank You,
Denise

1 REPLY 1

jMarshal
Mega Sage
Mega Sage

You might be able to accomplish this with a Business Rule which runs after an insert (specifically) and the State is "In Progress":

jMarshal_0-1686865963481.png


Then go to the Advanced tab and write a script which inserts a new record on the Task SLA table (task_sla) with the following attributes (remember, the BR is running on the Incident table - so "current" is the Incident record, not the Task SLA record that you are creating) :


task = current.number

active = false

business_duration = 1 (not sure what unit this is in, you may want to play around with this a bit)

has_breached = false

sla = SYS_ID of the SLA definition you are using (response SLA)

 

...there may be other fields that you'll need to populate on the Task SLA record also (end_time, duration, etc) - I'm not sure what your use case will be looking at, for the reporting and/or what ServiceNow will need on the Task SLA record, to accomplish your goal...but this should be a good starting point...


HAVING SAID ALL THAT -- have you considered changing your SLA start/stop condition(s), to accomplish your goal instead? I'd recommend that over a supplementary business rule to accommodate the fringe use case.

Perhaps the SLA start condition can be "active = true" (it will start as soon as it is created, regardless of state) and the stop condition of "not new" with a "retroactive start" to be "created" ?