- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 05:16 AM
Hello all,
Can anyone explain me how duration field calculated in the incident form ? provide an example to understand better.
I have referred a few docs and it wasn't clear for me. If possible please explain Business duration, Business resolve time and resolve time as well.
Also is there any field from above which will exclude on hold time of the incident?
Appreciate your help!
Thank you very much in advance.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 03:43 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
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
03-08-2022 12:52 AM
Did you get a chance to check on the link I shared?
It has detailed explanation
If my response helped please mark it correct and close the thread so that it benefits future readers.
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
03-09-2022 03:43 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
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
03-08-2022 12:48 AM
Hi
There are two Duration fields on Incident which are "Business duration" and "Calendar duration". Both Duration fields are calculated by the OOB business rule "mark_closed" on the incident table.
These are the following code in the business rule:
if (dataChange || current.business_duration.nil())
current.business_duration = gs.calDateDiff(opened, closed, false);
if (dataChange || current.calendar_duration.nil())
current.calendar_duration = gs.dateDiff(opened, closed, false);
Both Duration fields are actually calculated based on incident opened time and incident closed time only.
It is clear that duration for incident is calculated based on incident opened time and incident closed time only.
It is calculated regardless what states incident has ever been set to. The duration of incident is simply the time difference between incident opened time and incident closed time. Putting incident in "Awaiting User Info" state would definitely affect the duration for the incident because the pause period would be counted into the duration in this case.
Example
Incident create time: 3pm
Put incident into Awaiting User Info time: 4pm
Change incident state back to Active: 5pm
Close incident: 6pm
For this example, the duration of the incident would be 3 hours because it is created at 3pm and is closed at 6pm.
The points above are documented clearly by ServiceNow which explains this pretty well. Please refer the same below:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0754082#:~:text=The%20duration%20of%20incident%20is,time%20and%20incident%20closed%20time.
https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/time/concept/c_ResolveTime.html
https://community.servicenow.com/community?id=community_question&sys_id=bdf887a1db5cdbc01dcaf3231f9619a5
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke