This function adds or subtracts years to/from any given date.
addYears(timestamp, numberOfYears, timeZone) #Output: Number
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 16 Next »
This function adds or subtracts years to/from any given date.
addYears(timestamp, numberOfYears, timeZone) #Output: Number
Parser expression | Description |
---|---|
addYears({issue.created}, 10, LOCAL) | The function adds 10 years to the issue's creation date. |
addYears({issue.duedate}, -2, LOCAL) | This function subtracts 2 years from the issue's due date. |
addYears({issue.cf12025}, 1, USER_LOCAL) | This function adds 1 year to a custom date-time field (with ID 12025). Instead of the Jira server's local time this example uses the current user's time zone. |
Parameter | Input (data type) | Description |
---|---|---|
timestamp | NUMBER | The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). |
numberOfYears | NUMBER | The number defined here will be the offset in years. Negative values are used to substract years. Internally JWT multiplies this value with the time macro |
timeZone | TIMEZONE | The time zone used for the calculation. |
The function returns a NUMBER representing a timestamp.
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 a JWT calculated date-time fields.
Powered by Atlassian Confluence 8.5.9, themed by Refined 7.5.7 and Decadis AG