How to create report if Incident priority is updated or created by a specific group

pramodkumar
Tera Expert

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!

5 REPLIES 5

Abbas_5
Tera Sage
Tera Sage

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

AndersBGS
Tera Patron
Tera Patron

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/

Thank you. Can you let me know how to achieve with Metrics?

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/