- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 03:41 AM
I understand from a servicenow video, that this Metric Definition: Unassigned Duration per Assignment Group is OOTB. But I can't see it in our instances. Can someone please let me know the values set for all fields/scripts etc for this metric definition, so I can create it myself?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 07:41 AM - edited 07-29-2024 07:43 AM
I was able to figure it out! This community post reply by Harish Murikina was very helpful. https://www.servicenow.com/community/itsm-forum/metric-to-measure-time-before-unassigned-ticket-is-a... . You just create a new metric definition called "Unassigned Duration" or something like that. Use whatever table you are reporting on, select "Assigned to" as the field. Then, select Script Calculation as the type and paste the following script:
{
var value = false;
if (!current.active)
value = true;
createMetrice(value);
}
function createMetrice(value) {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.field_value = value;
gr.start = current.sys_created_on;
gr.end = gs.nowDateTime();
gr.duration = gs.dateDiff(gr.start.getDisplayValue(), gr.end.getDisplayValue());
gr.calculation_complete = true;
gr.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:21 AM
Take a look in your PDI. It should be there if it’s OOB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:15 AM
It wasn't.
The next part of the question was does anyone have that metric set up and if so , could they share the settings/values/scripts`? 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 01:58 AM
I agree, I don't have it in my PDI.... I am on Xanadu and can't find it anywhere..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 08:51 AM
I think I saw the same video and was wondering the same thing. I watched "Indicators on Metrics - Jan 27, 2021 - Performance Analytics Academy". I can't find it in my PDI either. Were you ever able to figure it out?