Page History
UI Text Box | ||||
---|---|---|---|---|
| ||||
This function adds or subtracts years to or from any given date. |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
addYears(timestamp, numberOfYears, timeZone) #Output: Number |
UI Expand | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
|
hidden | true |
---|
Status | ||
---|---|---|
|
Status | ||
---|---|---|
|
Status | ||
---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
hidden | true |
---|
size | medium |
---|---|
type | info |
UI Text Box | ||||
---|---|---|---|---|
| ||||
You should use this function instead of simply adding Negative values for n are used in order to subtract. |
UI Expand | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
Parser expression | Description |
UI Text Box | ||
---|---|---|
| ||
timestamp t with value March 25th, 2011 23:15 |
The function will return a timestamp as a
Status | ||||
---|---|---|---|---|
|
title | Additional information |
---|
Parameters used in this function
Parameter | Input (data type) | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
timestamp |
| The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). | ||||||||
numberOfDays numberOfYears |
| The number defined here will be the offset in daysyears. Negative values are used to substract dayssubtract years. Internally JWT multiplies this value with the time macro macro | ||||||||
timeZone |
| The time zone used for the calculation. |
ui-expand | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
This function returns a
| Learn more about timezones | |||||||||||||||
Excerpt Include | Dates, times and time zones | Dates, times and time zones | nopanel | true
UI Text Box | ||
---|---|---|
| ||
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. |
The output can be written into any Jira field of type Date Picker ore Date Time Picker. Another very common use case is to use this function in one of the JWT calculated date-time fields. |
Use case and examples
Page properties report | ||||||
---|---|---|---|---|---|---|
|
Page properties | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||
|
Page properties | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
| title | Output