This function returns the number of milliseconds the current issue has remained in a status with specific status.

If an issue has been in that status more than once, then duration will be summed up and the total time spent in the status will be returned.

Syntax
timeInStatus(statusName) #Output: Number
Examples
Expression parserDescription
timeInStatus("Open")

This example returns the number of milliseconds the current issue has stayed in status "Open"

timeInStatus("Open") / {HOUR}

This example returns the number of hours the current issue has stayed in status "Open"

{HOUR} is a time macro used to convert the output to hours.

timeInStatus(%{issue.status.previous}) / {MINUTE}
This example returns the number of minutes the current issue has stayed in previous status.
Additional information

Parameters used in this function

ParameterInput (data type)Description
statusName

TEXT

The input has to be a valid status name. Alternatively you can use field codes to retrieve the value.
Output

This function returns a NUMBER


Variant where you additionally define a custom calendar and time zone.

If an issue has been in that status more than once, then duration will be summed up and the total time spent in the status will be returned.

Syntax
timeInStatus(statusName, calendarName, timeZone) #Output: Number
Examples
Parser expressionDescription
timeInStatus("Open", "my_schedule", LOCAL) / {HOUR}

This example returns the number of hours the current issue has stayed in status "Open" within the schedule called "my_schedule" matching the server's default time zone.

{HOUR} is a time macro used to convert the output to hours.
Additional information

Parameters used in this function

ParameterInput (data type)Description
statusName

TEXT

The input has to be a valid status name. Alternatively you can use field codes to retrieve the value.
calendarName

TEXT

The input has to be a valid calendar name. Learn more about working with calendars.
timeZone

TIMEZONE

The time zone used for the calculation. 

Output

This function returns a NUMBER


Variant where you can additionally define multiple issues in an issue list.

The time across all issues will be summed up.

Syntax
timeInStatus(statusName, issueList) #Output: Number
Examples
Parser expressionDescription
timeInStatus("Open", subtasks()) / {HOUR}

This example returns the number of hours the current issue's sub-tasks have stayed in status "Open"

{HOUR} is a time macro used to convert the output to hours.

subtasks() is a function to return all subtasks.

Additional information

Parameters used in this function

ParameterInput (data type)Description
statusName

TEXT

The input has to be a valid status name. Alternatively you can use field codes to retrieve the value.
issueList

ISSUE LIST

The input has to be a valid issue list. Learn more about Lists.
Output

This function returns a NUMBER


Variant where you can define multiple issues in an issue list and additionally a custom calendar and time zone.

The time across all issues will be summed up.

Syntax
timeInStatus(statusName, issueList, calendarName, timeZone) #Output: Number
Examples
Parser expressionDescription
timeInStatus("Open", subtasks(), "my_schedule", LOCAL) / {HOUR}

This example returns the number of hours  the current issue's sub-tasks have stayed in status "Open" within the schedule called "my_schedule" matching the server's default timeZone.

{HOUR} is a time macro used to convert the output to hours.

subtasks() is a function to return all subtasks.

Additional information

Parameters used in this function

ParameterInput (data type)Description
statusName

TEXT

The input has to be a valid status name. Alternatively you can use field codes to retrieve the value.
issueList

ISSUE LIST

The input has to be a valid issue list. Learn more about working with lists.
calendarName

TEXT

The input has to be a valid calendar name. Learn more about working with calendars.
timeZone

TIMEZONE

The time zone used for the calculation. 

Output

This function returns a NUMBER