how to view response time in incident list.

padmaja9
Tera Contributor

Hi Team,

In incident list, we can able to access the response time and sla start fields related to task sla but the values are empty.

Is there any way to obtain their values from the respective tables and view them in incident list?

find_real_file.png

 

From the above screenshot we want the values of response time and other sla related fields in incident list. Help us in achieving the requirement.

Regards,

Padmaja.

1 ACCEPTED SOLUTION

Hi Padmaja,

Since that is the custom field you created are you populating it via some BR script etc

Also it should be duration field and not date/time as you want difference of 2 date/time values

you can use this BR to populate that field

BR: After update

Condition: Assigned to changes && current.u_response_time == ''

Script:

(function executeRule(current, previous /*null when async*/) {

var opened = new GlideDateTime(current.sys_created_on);
var now = new GlideDateTime();
var duration = GlideDateTime.subtract(opened, now);

current.<your_field> = duration;

})(current, previous);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Hi Pradeep,

Thanks for the reply. But I am able to view SLAs attached inside incident form. My requirement is to view the response time and SLA start time in incident list view which are now showing as empty (null value).

 

Help me out in viewing those field values in incident list view like the screenshot attached above.

 

Regards,

Padmaja. 

Sajilal
Mega Sage

Hi Padmaja,

These look like custom fields you have created on the incident table? if these are supposed to pull values from the task_sla table, then i am guessing there should be a business rule/Scheduled Job script for this. If not then you will have to implement one.(But figure out what values should be populated in these fields from task_sla table)

Thanks,

Saji

padmaja9
Tera Contributor

Hi Saji,

 

Thanks for the detailed process of troubleshooting. We have created a custom field u_response_time in incident table with type date/time.

find_real_file.png

 

Also we need to capture the duration from when ticket got opened(response SLA start time) to when the ticket got assigned (Response SLA stop time).

Found out that there are no business rules configured to configure this value from task sla table and view it on incident list.

Can you please help me out how can this value is visible in incident list by calculating duration between mentioned time from task sla table?

Regards,

Padmaja.

Hi Padmaja,

Since that is the custom field you created are you populating it via some BR script etc

Also it should be duration field and not date/time as you want difference of 2 date/time values

you can use this BR to populate that field

BR: After update

Condition: Assigned to changes && current.u_response_time == ''

Script:

(function executeRule(current, previous /*null when async*/) {

var opened = new GlideDateTime(current.sys_created_on);
var now = new GlideDateTime();
var duration = GlideDateTime.subtract(opened, now);

current.<your_field> = duration;

})(current, previous);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

The above business rule will calculate the duration between incident opened and time when any update is made right?

 

We want the duration to be calculated from incident open to sla response stop time (it stops when it is assigned to a person)

 

Can you please let me know how can we get response sla stop time from task sla table to business rule in incident table?

u_response_duration = response SLA start time(Ticket creation) – response SLA stop time(Ticket when assigned to a person) .

Regards,

Padmaja