Calculate state duration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2023 01:33 PM
Hi,
I want to calculate total time for which incident is on "In Progress" state how can I do it.I tried it with metric but it is creating seperate record if state changes from to another.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2023 02:08 PM - edited 01-07-2023 02:10 PM
Hi,
You can use metric table in reporting module.
Below is one similar report.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2023 02:36 PM
Hi @Rishabh Dev Kha ,
Have you looket into SLA breakdown as a possibility? https://docs.servicenow.com/en-US/bundle/tokyo-it-service-management/page/product/service-level-mana...
if my answer helped for a answering your question, please my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
this worked...here is the filter I used....attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2023 04:50 PM
Easiest is to configure a new Metric Definition. You can find it in the ServiceNow Navigator under Metrics -> Definition. There already is a Metric Definition for the Incident state field. You could create a new one but for field State. After that you can report on it as @Saurabh Gupta suggests.
Note that this will not create records for past incidents but only for future incidents. If you also need historic data, your accessible option is generating it using a Fix script that leverages the sn_hw.HistoryWalker() API - it enables accessing all records (with auditing enabled) with each of that record's state. You would need to create a script that loops through each incident then loops through each update of individual incidents and - of course - compute the length of state and save it as a Metric Instance record.
Below is something I just created (by copying the existing Metric for field Incident state) - you can see that it already captured values as I played with an incident in my PDI:
