How to calculate the incident duration field?
Release or Environment
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.
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.