- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 12:22 PM
Hi All,
I want to capture metric data regarding the last group who resolved Incident. I created new metric definition: "Last Assignment Group to Resolve Inc" below:
So when an incident ticket is created, it is assigned to the first group, then when the incident gets assigned/escalated to another assignment group and get resolved, I want to see the "End" field, the "Duration" field get populated with data and the "Calculation complete" is set to true.
My goal is to have any Metrics on ticket should be marked to Calculation completed and timestamped appropriately when moving to Resolved.
Thanks in advance for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:51 PM
Thanks for your feedbacks, Adam Stout and Göran Lundqvist. Unfortunately, the customer has different requirement than SLA Breakdowns.
Anyway, I was able to find a work-around with the below steps:
1. Create New Metric: "Incident Resolved"
2. Create test Incident ticket:
3. Validate in Metric: "Assignment Group",
Thank you.
Bachtiar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 03:40 PM
Why does the requestor care how you get it? Why does it have to be a metric?
SLA Breakdowns provide a lot more functionality (for instance resets, pauses, and business time).
You can do this with a BR (but I'm not sure a metric) since the driving event isn't on the field that is changing. When the incident is closed look up the existing metric and mark it complete. I wouldn't do this, but it could be done. SLA Breakdowns seem like a much better fit here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 03:41 PM
Hi,
That is hard. This is one of the times where the one who writes the requirements doesn't have the knowledge of how things work in ServiceNow and therefore writes solutions that probably isn't the best solution in both timewise to build, but also administrate it. I myself can't see why it needs to be in metrics. I would go back to whoever wrote the requirements and talk to them about the possibility to use SLA breakdowns instead. And as Adam writes below, the SLA Breakdowns also takes care of pitfalls like if the incident goes from resolved back to WIP and so on.
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 03:15 PM
SLA Breakdowns seem like the way to go. The danger with metrics here is what if it gets unresolved and you need to change it again? if you already completed it, it could look at bit funky.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:51 PM
Thanks for your feedbacks, Adam Stout and Göran Lundqvist. Unfortunately, the customer has different requirement than SLA Breakdowns.
Anyway, I was able to find a work-around with the below steps:
1. Create New Metric: "Incident Resolved"
2. Create test Incident ticket:
3. Validate in Metric: "Assignment Group",
Thank you.
Bachtiar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 09:14 AM
Super helpful, thanks!
We're using it to track incident.priority but also wanted to stop tracking at incident.state == 'Resolved' vs 'Closed'. This works perfectly.
Here's the script typed out to make it easier for the next person:
//incident.state = Resolved is 6
if (current.state == 6) {
answer = false;
mi.endDuration();
closeMetricDuration(mi.current);
}
function closeMetricDuration(current) {
var gr = new GlideRecord('metric_instance');
gr.addQuery('id', current.sys_id);
gr.addQuery('calculation_complete', false);
gr.addQuery('definition.type', 'field_value_duration');
gr.addQuery('definition.name', 'Incident Priority Duration');
gr.query();
while (gr.next()) {
var definition = new GlideRecord('metric_definition');
definition.get(gr.definition);
var mi = new MetricInstance(definition, current);
mi.endDuration();
}
}