Incident Age Calculate Report-Live Tracking
HIi All,
This post covers the simpler way to show incident open date to current date/time (Incident age)Live Tracking.
Step:1
I'm creating one Duration field in incident Form.
Step:2
After create style's.
Step:3
Then create Business Rule.
Name:Incident Age Calculate
Table:Incident
When to Run :Async(Insert,Update,Query)
Filter Condition:Active is True
Script:
(function executeRule(current, previous /*null when async*/) {
calculateAge();
function calculateAge()
{
var datedif = gs.dateDiff(current.sys_created_on.getDisplayValue(), gs.nowDateTime(),false);
current.u_incident_age = datedif;
current.update();
}
})(current, previous);
Note: create one incident then observe Incident age field its automatically update every 10 sec with out refresh page, After create one Incident List Report and add to this field in report.Save and Run your report its looking like below .
Important: 1.If Incident is closed its automatically color(RED) change and stop calculate duration(Incident age).
2.If you want update existing records go through Scheduled job.
Thanks,
Srinath Patel
This document was generated from the following discussion: Incident Age Calculate Report-Live Tracking
https://www.servicenow.com/community/platform-analytics-articles/incident-age-calculate-report-live-tracking/ta-p/2304923