How to create a Metric script to calculate State duration.

Shadi1
Kilo Contributor

Hello All,

We started using service now a few weeks ago and I am struggling to create a report as i can't find the right information. I need to display the average time on each State for the tickets created( Incident and Requests). The State column is available but it displays only the current state of the ticket and no duration values.

I've checked this out and I think that I need to create a Metric but I don't have any clue on the script that I will have to use, If anyone here knows how to create this and can assist me, any help is welcome.

Thank you very much!

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

Out of the box there is a Metric named- Incident State Duration

You should be able to report on incident_metric table with conditions Definition - is - Incident State Duration

then group by ID so all state changes per task are grouped together.

 

We don't have similar metric on request table, so you'd have to create one to start capturing the data.

View solution in original post

9 REPLIES 9

Shadi1
Kilo Contributor

Hey Michael,

 

Thank you for your answer, I've managed to find this out while this question was moderated as I played around with the Metrics, My challenge now is to make a calculation which will display total tickets created  - total ticket closed /each month.

Do you think this is possible ?

 

Not using the Metric but using a normal report or PA.

Shadi1
Kilo Contributor

We don't have access to PA yet, with reporting is just counting all the tickets and adding filter to remove the closed tickets and this will display the same result i suppose.

Free PA should contain the basic reports you need, for Incidents. Did you review?

Shadi1
Kilo Contributor

One last issue with this, I want to capture tickets open per Month - tickets closed in that month but some of those tickets where open in the previous month but the closed count needs to be in the month that was closed so it could be that in 1 month we opened 1000 tickets and closed only 500 and in the next month we opened 500 tickets and closed 1000 as we had 500 from the previous month, is there any way to display this calculation ?