Versions Compared

Key

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


UI Text Box
sizemedium
typeinfo

This function returns a text representing a time duration (in milliseconds), i.e. the difference between two date-time values, using the current user's language.


Code Block
languagebash
titleSyntax
linenumberstrue
formatDuration(duration) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
formatDuration(2020-01-31 11:30 - 2020-01-30 00:00)


This example returns:

1 day, 11 hours, 30 minutes

(Given the user language is set to English.)


Code Block
languagebash
linenumberstrue
formatDuration(60000)


This example returns:

1 minute

(Given the user language is set to English.)


Code Block
languagebash
linenumberstrue
formatDuration({issue.resolutionDate} - {issue.created})


This example returns the time between the creation and resolution of an issue.




UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
duration

Status
subtletrue
titlenumber

A number representing a duration (in milliseconds) or the calculation of a duration.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext


UI Text Box
typetip

This function is extremely helpful when you want to automatically calculate the duration in JWT calculated text fields.

If you prefer a more comprehensive representation, please see shortFormatDuration().

FunctionOutput
shortFormatDuration()1d 11h 30m
formatDuration() 1 day, 11 hours, 30 minutes




Use cases and examples

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


Page properties
hiddentrue
id1


Parser function cloud
Map(error)
Notes

There's not really a workaround for this, because Jira Expressions don't let you calculate the difference between dates, nor working with Duration values.

Also, with our parser we can calculate the difference, but we can't format it.




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



Page properties
hiddentrue


Short description

Returns a duration in text form.

Output

Status
subtletrue
titletext

Label