Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue
Status
Tech review

Status
titletodo

Style guide

Status
titletodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged

Page properties
hiddentrue
Short description

Returns the

Status
subtletrue
titlenumber
of milliseconds the current issue has remained in a status with name status_name.

Output

Status
subtletrue
titlenumber

UI Text Box
sizemedium
typeinfo

This function returns the number of The function returns the

Status
subtletrue
titlenumber
of milliseconds the current issue has remained in a status with name specific status_name.

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.


Code Block
languagebash
titleSyntax
linenumberstrue
timeInStatus(string status_namestatusName) #Output: Number


In order to display this value in a more readable way, the milliseconds should be transformed into a more readable unit, like in the following example:
UI Expand
titleExamples


Expression parserDescription


Code Block
languagebash
linenumberstrue
timeInStatus("Open")
The function


This example returns the

Status
subtletrue
titlenumber
of

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

UI Text Box
typetip


Code Block
languagebash
linenumberstrue
timeInStatus("Open") / {
DAY} - for number of days, or timeInStatus("Open") / {HOUR} - for number of hours
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.


Code Block
languagebash
linenumberstrue
timeInStatus(%{issue.status.previous}) / {MINUTE}


This example returns the number of minutes the current issue has stayed in previous status.



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>
statusName

Status
subtletrue
titledata typetext

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



UI Expand
titleOutput

The This function returns a

Status
subtletrue
titlenumber




UI Text Box
sizemedium
typeinfo

The function returns the 

Status
subtletrue
titlenumber
of milliseconds the current issue has remained in a status with a name "status_name" within a schedule_name for a given time_zoneVariant 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.


Code Block
languagebash
titleSyntax
linenumberstrue
timeInStatus(string status_namestatusName, string schedule_namecalendarName, timeZone time_zone) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
timeInStatus("Open", "my_schedule", LOCAL) / {HOUR}
the function returns the 
Status
subtletrue
titlenumber
of milliseconds


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

timeZone

time zone.

UI Text Box
typeinfo
{HOUR} is a time macro used to convert the output to hours.




UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>statusName

Status
subtletrue
title

data typeParameter description.

text

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

Status
subtletrue
title

data type
text

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

Status
subtletrue
titletimezone

The time zone used for the calculation. 

Expand
titleLearn more about timezones
Excerpt Include
Dates, times and time zonesDates, times and time zones
nopaneltrue



-textbox
ui
-
typetip

Work days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia. 

ui-expand
titleOutput

The This function returns a

Status
subtletrue
titlenumber




UI Text Box
sizemedium
typeinfo

the function returns a

Status
subtletrue
titlenumber
representing the sum of milliseconds Variant where you can additionally define multiple issues in an issue list issues have remained in a status with the name "status_name". If an issue from that list has been in that status more than once, then list.

The time across all issues duration will be summed up and the total time spent in the status will be returned.


Code Block
languagebash
titleSyntax
linenumberstrue
timeInStatus(string status_namestatusName, issue list issuesissueList) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
timeInStatus("Open", subtasks()
The function returns the
Status
subtletrue
titlenumber
of milliseconds the
) / {HOUR}


This example returns the number of hours the current issue's sub-

tasks

tasks have stayed in status "Open"

ui-text-box
typeinfo

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

subtasks() is a function to return all subtasks.




ui-expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>statusName

Status
subtletrue
title

data typeParameter description.

text

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

Status
subtletrue
title

data type
issue list

The input has to be a valid issue list. Learn more about ListsParameter description.



UI Expand
titleOutput

The This function returns a

Status
subtletrue
titlenumber




UI Text Box
sizemedium
typeinfo

The function returns a

Status
subtletrue
titlenumber
representing the sum of milliseconds Variant where you can define multiple issues in an issue list issues have remained in a status with the name "status_name" within a schedule named "schedule_name" for a given time_zone. If an issue from that list has been in that status more than once, then duration will be summed up and the total time spent in the status will be returnedlist and additionally a custom calendar and time zone.

The time across all issues will be summedup.


Code Block
languagebash
titleSyntax
linenumberstrue
timeInStatus(string status_namestatusName, issue list issuesissueList, string schedule_namecalendarName, timeZone time_zone) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
timeInStatus("Open", subtasks(), "my_schedule", LOCAL)
The function returns the 
Status
subtletrue
titlenumber
of milliseconds
 / {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.

UI Text Box
typeinfo

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

subtasks() is a function to return all subtasks.




UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>statusName

Status
subtletrue
title

data typeParameter description.

text

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

Status
subtletrue
title

data typeParameter description.

issue list

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

Status
subtletrue
title

data type
text

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

Status
subtletrue
titletimezone

The time zone used for the calculation. 



ui-expand
title
Learn more about timezones
Excerpt Include
Dates, times and time zonesDates, times and time zones
nopaneltrue
UI Text Box
typetip

Work days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia. 

UI Expand
titleOutput
Output

This function returns a

Status
subtletrue
titlenumber



Image AddedUse cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_timeinstatus" and space = currentSpace()


Page properties
hiddentrue
id1


Parser function cloud
Map(error)
NotesNot possible because that kind of information is not available.




Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



number
Page properties
hiddentrue


Short description

Returns the time the current issue has remained in a specific status.

Output

Status
subtletrue
titlenumber

Available since

Status
subtletrue
colourRed
titleneeds lookup

Label

Status
colourRed
titlestaff pick

The function returns a
Status
subtletrue
title