HOURS_SPENT_IN_STATE¶
Description¶
HOURS_SPENT_IN_STATE returns the total number of hours a case has spent (or has so far spent) in a given state, based
on the case's transition history.
You can pass the state positionally or using the named argument state.
If you need the result in days rather than hours, use DAYS_SPENT_IN_STATE.
The optional arguments that narrow what counts are described under counting elapsed time.
Example¶
This returns the number of hours the current case has spent in the in_review state.
Example with named argument¶
Arguments¶
HOURS_SPENT_IN_STATE accepts the same narrowing arguments as HOURS_BETWEEN, so
HOURS_SPENT_IN_STATE(state: 'in_review', exclude_weekends: true) counts hours on working days only.
day_length is not among them, since the result is already counted in hours.
Naming any one of them means the state has to be named as well.
Info
New in Atfinity 17.
A named argument that is neither state nor one of the narrowing arguments is rejected, where it was previously
ignored.