Monthly trends by response

Casey4
Tera Contributor

I need to build a  SLA dashboard - trending by month on when the response and resolution times have been meet 

How can I do this in PEFORMANCE Analytics?

5 REPLIES 5

Amit Gujarathi
Giga Sage
Giga Sage

HI @Casey4 ,
I trust you are doing fine.

To build an SLA dashboard in Performance Analytics, you'll need to follow these steps:

  1. Define your SLAs: Before you can track your SLA performance, you need to define your SLAs in ServiceNow. This involves setting target response and resolution times for each service, as well as defining the conditions under which SLAs should be triggered.

  2. Create indicators: Next, you'll need to create Performance Analytics indicators to track your SLA performance. You can create indicators for response time, resolution time, and SLA compliance. These indicators will measure how well you're meeting your SLAs over time.

 

var sla = new GlideRecord('contract_sla');
sla.addQuery('name', 'My SLA');
sla.query();

if (sla.next()) {
  var pa = new GlideRecord('pa_indicator');
  pa.name = 'My SLA Compliance';
  pa.aggregation = 'sum';
  pa.table = 'incident';
  pa.filter = 'active=true^incident_state!=6';
  pa.formula = 'SUM(IF(response_time_breach=false AND resolution_time_breach=false, 1, 0)) / COUNT(*)';
  pa.pa_source = sla.sys_id;
  pa.insert();
}

 

This code creates a PA indicator for an SLA named "My SLA". It measures SLA compliance for incidents, excluding those that are closed. The formula calculates the percentage of incidents that met the SLA based on the response and resolution time breaches.

  1. Create a dashboard: Once you have your indicators, you can create a Performance Analytics dashboard to visualize your SLA performance over time. You can use widgets like line charts and scorecards to display your SLA trends by month.

Here's

 

var dashboard = new GlideRecord('pa_dashboards');
dashboard.name = 'SLA Dashboard';
dashboard.type = 'standard';
dashboard.insert();

var widget = new GlideRecord('pa_widgets');
widget.dashboard = dashboard.sys_id;
widget.type = 'line_chart';
widget.filter = 'name=My SLA Compliance^duration=month^sysparm_pa_widget_query=';
widget.insert();

 


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Tsura Andreeva
Mega Sage

You also might want to check and see if you can use these, we do have some SLA indicators OOTB

SLA.PNG

 

thanks Tsura

How do I get a list of all these within the instance?