Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
UI Text Box
sizemedium
typeinfo

This function adds or subtracts days to or from any given date.

Code Block
languagebash
titleSyntax
linenumberstrue
addDays(timestamp, numberOfDays, timeZone) #Output: Number
UI Expand
titleExamples
Parser expressionDescription
Code Block
linenumberstrue
%{addDays({issue.duedatedueDate}, 2, RUN_AS_LOCAL)}

This example adds 2 days to the issue's due date. 

Code Block
linenumberstrue
%{addDays({issue.duedatedueDate}, -2, RUN_AS_LOCAL)}

This example subtracts 2 days from the issue's due date.

Code Block
linenumberstrue
%{dateTimeToString(addDays(1582930800000, -2, "Europe/Berlin"), "MMMM D YYYY, h:mm:ss a","es")}

This example subtracts 2 days from a timestamp which represents February 29th, 2020.

The obtained result is February 27th, 2020 12:00:00 am. The result is formatted using the function dateTimeToString()

UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
timestamp

Status
subtletrue
titlenumber

The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).

numberOfDays

Status
subtletrue
titlenumber

The offset in days. Negative values are used to subtract days.

timeZone

Status
subtletrue
titletext

The time zone used for the calculation. 

UI Expand
titleOutput

This function returns a 

Status
subtletrue
titlenumber
 representing a timestamp

UI Text Box
typetip

The output can be written into any Jira field of type Date Picker or Date Time Picker.

Page properties
hiddentrue

Status
Tech review

Status
colourYellowGreen
titleReady for reviewdone

Style guide

Status
colourYellow
titleReady for review

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

Page properties
hiddentrue
Short descriptionAdds or subtracts days to or from any given date.
Output

Status
subtletrue
titlenumber

Available since


Label