- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 04:35 AM
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?
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 11:26 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 09:40 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 10:12 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 11:06 PM
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 11:26 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 10:33 PM
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