How to create report if Incident priority is updated or created by a specific group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 09:06 PM
Hi All,
I am looking to create a report if a incident at some point is update to P2 or created as P2 by a specific team. How can we achieve this?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 09:24 PM
Hello @pramodkumar,
Similar kind of request, please refer to the link below:
https://www.servicenow.com/community/platform-analytics-forum/create-a-report-on-priority-change-for...
Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 11:18 PM
Hi @pramodkumar ,
A solution could be to create an OLA with start condition "assignment group is XXX AND priority is P2". Another solution could be to create an incident metric definition, but some scripting is needed as you both want to capture assignment group and priority.
If my answer has helped with your question, please mark 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
12-05-2023 08:40 AM - edited 12-05-2023 08:40 AM
Thank you. Can you let me know how to achieve with Metrics?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 02:18 AM
Hi @pramodkumar ,
Please see below scripted metric definition:
//get incident assignment group
var group = current.assignment_group;
//get incident priority
var priority = current.priority;
//Check if assignment group is software and priority is 2
if (group == '8a4dde73c6112278017a6a4baf547aa7' && priority == 2)
//if true create metric
createMetric();
function createMetric() {
var mi = new MetricInstance(definition, current);
//Check if a metric already exists, so that only one metric will be created
if (mi.metricExists())
return;
//Creation of the metric instance
var gr = mi.getNewRecord();
//get when the incident was created
gr.start = current.sys_created_on;
//get when the assignment group was set to software and priority was set to P2
gr.end = current.sys_updated_on;
//Calculate the time difference
gr.duration = gs.dateDiff(gr.start.getDisplayValue(),gr.end.getDisplayValue());
gr.calculation_complete = true;
gr.insert();
}
If my answer has helped with your question, please mark 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/