Time Difference

klbhargav3
Tera Contributor

How to calculate time difference between created on and resolved at .

4 REPLIES 4

J Siva
Tera Sage

Hi @klbhargav3 
There are different ways to achieve that, such as using metrics or scripts. Could you please share your specific requirement so we can suggest the most suitable approach?
Regards,
Siva

--> Create a field on incident form , field name : MTTR

And field type is : Time

--> When a incident is resolved , we need to caluculate the MTTR ( Mean time taken to Resolve)

Suppose a incident created at 14/03/2025 11:08:00AM

And Resolved at             14/03/2015  12:40:00PM

Mean time should populate : 48 minutes

@klbhargav3 Instead of creating custom field on the Incident form, you can use either the exisitng SLA definitions or Metrics to see the resolution time.
You can use Actual elapsed / Business elapsed time coulmn to get the MTTR.

Ankur Bawiskar
Tera Patron
Tera Patron

@klbhargav3 

there is already an OOTB business rule for this calculation

you can refer that and enhance your script

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader