How to create a Metric Definition

Eddie5
Tera Contributor

Hi Everyone,

I am learning servicenow, can you please help me with a script on metric definition to report on number of incidents where incident priority was upgraded.

Example - I created an incident in P4 - priority and agent updated priority to P2 and after some time he updated it again to P1, now we must be able to report on all incidents where priority was upgraded from lower to higher;

Initial Priority = P4, upgraded to P3,P2,P1

Initial Priority = P3, upgraded to P2,P1

Initial Priority = P2, upgraded to P1

3 REPLIES 3

Bhawanjit Sing2
Mega Guru

Best way to learn is to check few OOB setup under metric_definition table.
like : Incident State Duration


Product document : Define a metric

Hi Bhawanjit, State definition count on Incident state changes, not on priority. Well my ask is to count all incidents where priority was upgraded. please refer example given above in problem statement. Thanks!

Priyanka_786
Tera Guru
Tera Guru

@Eddie5 : Please check below thread for approach .

https://www.servicenow.com/community/developer-forum/priority-duration-metric-calculation/m-p/187828...

 

Hope it helps.

Please mark my response as correct/helpful if it helps you.

Regards,

Priyanka Salunke