This function adds or subtracts years to or from any given date.
addYears(timestamp, numberOfYears, timeZone) #Output: Number
Examples
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example adds 10 years to the issue's creation date. |
|
Bash
|
This example subtracts 2 years from the issue's due date. |
|
Bash
|
This example 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. |
Additional information
Parameters used in this function
|
Parameter |
Input (data type) |
Description |
|---|---|---|
|
|
number |
The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). |
|
|
number |
The offset in years. Negative values are used to subtract years. Internally JWT multiplies this value with the time macro |
|
|
timezone |
The time zone used for the calculation. |
Output
This 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 one of the JWT calculated date-time fields.
(books) Use case and examples
| Use case |
|---|
| No content found. |