logo

NJP

Creating Incident First Reply Time Metrics

Import · Oct 20, 2017 · article

As of this writing, with or without Performance Analytics enabled, ServiceNow doesn't come preconfigured to measure Incident First Reply Time (the amount of time it takes an agent to write the first public comment). Prior to migrating to ServiceNow, we had been using First Reply Time for years, in coordination with other KPIs (like update frequency, resolution time, and rework), to continuously improve our customer satisfaction. It was one of the first metrics we wanted to recreate once we were up and running. This article describes our process.

We approach First Reply Time from two angles, table metrics and platform metrics, to give greater flexibility in reporting. You can feel free to simplify it by removing one or the other. If you aren't sure how, just leave a comment below and @-mention me in it.

First, we first add five new fields to the Incident table, each named with an "u_mm_" prefix to indicate this was created by Michigan Medicine. One field records the exact time of first reply, the others record different formats for the duration between the time the Incident was opened and the time the first reply was posted. (We record both the business and calendar durations in hours:minutes:seconds format and a sum of seconds format, the same way that resolution time is recorded in the Incident table.) Once the fields are created, we add a new Metric definition, then a new Business Rule to watch for the first reply event. When the first reply happens, the Business Rule sets all the new field values and inserts a new metric into the metric_instance table. We then remove all the new fields from the Incident form (so they don't clutter the interface).

Step Action
1 Login to ServiceNow as a user with the admin role.
2 Click Tables under System Definition in the left-navigation bar. Search for the Incident table and open it, then click New beside Table Columns. Set Type to Date/Time, Column Label to First Reply At, and Column Name to ***u_mm* _first_reply_at. Click Submit.
3 Create another new Incident table column. Set Type to Duration, Column Label to First Reply Business Duration, and Column Name to u_mm_first_reply_business_duration. Click Submit.
4 Create another new Incident table column. Set Type to Duration, Column Label to First Reply Duration, and Column Name to u_mm_first_reply_calendar_duration. Click Submit.
5 Create another new Incident table column. Set Type to Integer, Column Label to First Reply Business Seconds, and Column Name to ***u_mm_first_reply_business_stc. Click **Submit*.
6 Create another new Incident table column. Set Type to Integer, Column Label to First Reply Seconds, and Column Name to u_m m_first_reply_calendar_stc. Click Submit.
7 Click Definitions under Metrics in the left-navigation bar and then click New beside Metric Definitions. Set Name to Incident First Reply Time, Table to Incident [incident], Field to First Reply At, Type to Script Calculation, and Description to If this is the first public reply to the Incident by an Agent with the itil role, create a metric instance and record the first reply duration. This script is empty because a business rule does the heavy lifting. Click Submit.
8 Click Definitions under Metrics in the left-navigation bar and then open the metric you just created. Look in your browser's URL field and you will see sys_id_followed by a string of numbers and letters (like "462cf6520a25810200ebe763047cc273") in between '=' (or _%3D) and '&' (or %26). Copy that string. It's the sys_id for your new metric and you'll need that in the next step.
9 Click Business Rules under System Definition in the left-navigation bar. Click New beside Business Rules. Set Name to Set Incident First Reply Time, Table to Incident [incident], and Advanced to true. On the When to Run tab, set Update to true and add two filter conditions that both must be met: First Reply At is empty AND Additional Comments changes. Click the pencil icon to edit user roles, add the itil role, and click Done. On the Advanced tab, set Script to:// Set metricSysID to the sys_id of the Incident First Reply Time metric definition.var metricSysID = '4322bf44db730300f653f34ebf96193e'; // Set scheduleSysID to the business hours schedule you want (System Scheduler > Schedules > Schedules). "8-5 weekdays excluding holidays" is default. var scheduleSysID = '090eecae0a0a0b260077e1dfa71da828';// If this is the first public reply from an itil-role agent, u_mm_first_reply_at isn't setif (current.u_mm_first_reply_at.nil())   // Set u_mm_first_reply_at to the current time   current.u_mm_first_reply_at = gs.nowDateTime();// Update the fields that indicate the time/duration of the incident from open to first reply.// Keep track of duration as a glide_duration value (dd hh:mm:ss) and as a pure number of seconds.// Both calendar time and business time are maintained.var dataChange = current.opened_at.changes() \ current.u_mm_first_reply_at.changes();var schedule = new GlideSchedule(); schedule.load(scheduleSysID);if (dataChange current.u_mm_first_reply_business_duration.nil())   current.u_mm_first_reply_business_duration = schedule.duration(current.opened_at.getGlideObject(), current.u_mm_first_reply_at.getGlideObject()); if (dataChange
10 Click All under Incident in the left-navigation bar. Open any incident you like. Click the hamburger icon to expand the Additional Actions menu, then click Form Layout inside the Configure submenu. In the Selected list, shift-select First Reply At, First Reply Business Duration, First Reply Duration, First Reply Business Seconds, and First Reply Seconds. Click the < button to move them to the Available list, then click Save.

Labels:

image

View original source

https://www.servicenow.com/community/platform-analytics-articles/creating-incident-first-reply-time-metrics/ta-p/2304239