The CreatorCon Call for Content is officially open! Get started here.

Calculate SLA times based on custom Start/End fields

Ernesto di San1
Giga Contributor

Dear all,

I have 2 custom fields in my incident form: "Start Time" and "End Time", those fields are filled by operators (only for a specific category of incidents...)

I'd like to calculate SLA times based on these 2 fields. ServiceNow gives the possibility to set a retroactrive start time setting it to a specific field ("Set start to" field in SLA definition form).

I was wondering if there is the possibility to select also a datetime field to set the official "stop" of the SLA. Any info about? or any workaround to achieve the goal?

Thanks to all

Cheers

Ernesto

4 REPLIES 4

anurag92
Kilo Sage

As you pointed out, start time can be a custom 'stat time' field. Yes, you can stop the SLA by specifying the Stop conditon as 'end time' is not empty. This will calculate the final SLA as time between start and end time.



Let me know if I caught your question correctly.


Hi Anurag,


first of all thanks for your feedback. Well, my question is a bit different, I want to stop the SLA (and yes, I can do that with condition suggested by you), but I need to calculate time elapsed between my custom Start and End time. Let me explain better with an example:


Operator set Start Time value as "2016/10/26 10:00:00" and set the End Time as "2016/10/26 12:00:00". Even if both fields are populated at 14:00:00, SLA elapsed time should be 2 hours (from 10:00:00 to 12:00:00, from Start to End).


Regarding the Start Time, I can set retroactive start to my custom "Start Time" field, but I cannot find a way to tell ServiceNow to calculate the end of SLA time by using my End Time custom field. Is there any possibility to do that?



Thanks


Ernesto


anurag92
Kilo Sage

Well, Ernesto. I believe this is not possible with OOB scripts. If you check, there would be script includes for/on SLA table that keep on calculating difference of current time and Start time and based on this calculations: Elapsed time & Elapsed Percentage fields are populated. Now updating these script includes would have a system-wide impact and is not advisable. So, I would recommend writing a BR, that whenever 'End Time' on Incident is updated, SLA for Incident stops and the elapsed time is difference of 'start time' and 'end time'.


That's what I was supposing... OOB system doesn't allow this kind of operation...


Thanks again Anurag for your support, I'll proceed with a BR as suggested