Duration of a request item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 08:29 AM
What parameters should I use to produce a report for average duration of a request item. I have found a report on the benchmark dashboard but I need to create reports within ServiceNOW and add them to a Dashboard for our exec leadership team.
- Labels:
-
Reporting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2022 07:14 PM
Hi Christina,
If you need a single score report (average of the RITM's time) like this:
You will then need to create a Metric Definition (admin role required).
Here is an example:
And here is the script:
var s = current.active;
if (s == false)
createMetric();
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.start = current.sys_created_on;
gr.end = current.sys_updated_on;
gr.duration = gs.dateDiff(gr.start.getDisplayValue(), gr.end.getDisplayValue());
gr.calculation_complete = true;
gr.insert();
}
This will then create records in the metric_instance table every time a RITM is closed, calculating the time from Open to Close.
You can then create a report on the metric_instance table. If you need to filter which RITMs will be in that report, you will then need to create a Database View combining the metric_instance and the sc_req_item table, only for the metric definition = "Create to Close Duration". An example of this is the incident_metric database view, for incidents.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 01:07 PM
I am getting the same request and I was able to follow the instructions you provided for the single score report. I haven't been able to populate the "Duration" time from the Metric Definition to the Requested Item table so I can report on sc_req_tem table for duration time. Do you know how this can be achieved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 11:21 AM
The solution from JP is right AND on the metric_instance table.
That table can be huge since it has all the metrics from all tasks (incident, ritms, etc.).
In addition, in your report you WON'T be able to add fields from the task since you can't dotwalk back to it.
Type "database view" on the left nav and get familiar with it. Add this to your instance to visualize the DB view called "sc_req_item_metric": /sys_db_view.do?sys_id=60070b27c0a8016600e92d309cf60fcb
This DB view combines all fields from the ritm record (task) PLUS the records from the actual metric, which most likely you want the duration field. Remember to add condition to filter the metric that you actually want to calculate the average ("Create to Close duration").
Hope this helps.
If I helped you with your case, please click the Thumb Icon and mark as Correct.