create a report based on incident priority change

Gaurav Vaze
Kilo Sage

I want to create a report, that will show the incident based on priority change
I have created the Metric definition for the priority field
and also created a report which is on the Incident_metric table and the definition is one that I mentioned earlier.
However, this report does not take into account the previous incidents
I want it to show only those incidents whose priority has changed in the last 3 months
adding SS of the created definition and  report

GauravVaze_0-1714733749551.pngGauravVaze_1-1714733778038.png
Help will be appreciated 
Thank you in advance

 

 

1 ACCEPTED SOLUTION

Gaurav Vaze
Kilo Sage

I have found a workaround for the question I posted
please follow following steps to get the report

step A] create a metric definition on the priority field

  • Navigate to Metric definitions (metric_definition)
    GauravVaze_0-1715154864105.png

     

  • click on new
  • choose a table as Incident
  • choose type as field value duration
  • choose field as Priority

    GauravVaze_1-1715155004476.png

     

step B] Create a script include to get the unique records having the priority actually changed

  • under system definition, navigate to script include and click on new
  • give the appropriate name and paste the following code(note the name of SI will be different  in your case)

    GauravVaze_3-1715155373481.png

     

  • save

step C] Create a report on the incident_metric table

  • navigate to create a new inside report
  • give title, choose table as incident_metric
  • choose type as list
  • choose filter as: definition is [your definition name create din first step] and sys_id(inc_sysid) is one of the 
    javascript: new (your Si name here followed with ()).(your function name inside SI followed with ())
    (example: javascript:new ICgetMetricInstances().createMetric();)
    GauravVaze_4-1715155508234.png

     



    Note: this will give you those incidents for which priority is changed actually 

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

HI @Gaurav Vaze 

 

Metric will capture only changes when it become active, not the historical changes. So if you create metric a 2 days back and in that duration the incident get change that will be captured. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

HI @Dr Atul G- LNG 
I understood that
but i need a way to create a report for my requirement
so how can I create a report for the same?
any suggestions?

Not possible mate,  only other way is sys audit log and it may or may not give the exact results.

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

AndersBGS
Tera Patron
Tera Patron

Hi @Gaurav Vaze ,

 

Metrics wont capture historical changes - only changes to priority field going forward. 

 

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/