timeInStatus()

Status name

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.

Bash
timeInStatus(statusName) #Output: Number

Examples

Expression parser

Description

Bash
timeInStatus("Open")

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

Bash
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.

Bash
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

Parameter

Input (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

Calendar name

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.

Bash
timeInStatus(statusName, calendarName, timeZone) #Output: Number

Examples

Parser expression

Description

Bash
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

Parameter

Input (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

Issue list

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

The time across all issues will be summed up.

Bash
timeInStatus(statusName, issueList) #Output: Number

Examples

Parser expression

Description

Bash
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

Parameter

Input (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

Issue list calendar name

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.

Bash
timeInStatus(statusName, issueList, calendarName, timeZone) #Output: Number

Examples

Parser expression

Description

Bash
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

Parameter

Input (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

📚 Use cases and examples