This function adds or substracts natural days (or working days) to/from any given date.
Weekends will not be counted as working days.
addDaysSkippingWeekends(timestamp, numberOfDays, timeZone) #Output: Number
Parser expression | Description |
---|---|
addDaysSkippingWeekends({issue.duedate}, 2, LOCAL) | This function adds 2 working days to the TIMESTAMP of the issue due date.
|
addDaysSkippingWeekends({issue.duedate}, -2, LOCAL) | This function substracts 2 working days from the TIMESTAMP of the issue due date.
|
addDaysSkippingWeekends({issue.cf10100}, -6, USER_LOCAL) | This function substracts 6 working days from the TIMESTAMP of a custom date-time field (with the ID 10100). Instead of the Jira server's local time this example uses the current user's time zone. |
Parameters used in this function
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). |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam fermentum vestibulum est. Cras rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed quis tortor. Donec non ipsum. Mauris condimentum, odio nec porta tristique, ante neque malesuada massa, in dignissim eros velit at tellus. Donec et risus in ligula eleifend consectetur. Donec volutpat eleifend augue. Integer gravida sodales leo. Nunc vehicula neque ac erat. Vivamus non nisl. Fusce ac magna. Suspendisse euismod libero eget mauris. Ut ligula. Maecenas consequat. Aliquam placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla convallis. Ut quis tortor. Vestibulum a lectus at diam fermentum vehicula. Mauris sed turpis a nisl ultricies facilisis. Fusce ornare, mi vitae hendrerit eleifend, augue erat cursus nunc, a aliquam elit leo sed est. Donec eget sapien sit amet eros vehicula mollis. In sollicitudin libero in felis. Phasellus metus sem, pulvinar in, porta nec, faucibus in, ipsum. Nam a tellus. Aliquam erat volutpat. Sed id velit ut orci feugiat tempus. Pellentesque accumsan augue at libero elementum vestibulum. Maecenas sit amet metus. Etiam molestie massa sed erat. Aenean tincidunt. Mauris id eros. Quisque eu ante. Fusce eu dolor. Aenean ultricies ante ut diam. Donec iaculis, pede eu aliquet lobortis, wisi est dignissim diam, ut fringilla eros magna a mi. Nulla vel lorem. Donec placerat, lectus quis molestie hendrerit, ante tortor pharetra risus, ac rutrum arcu odio eu tortor. In dapibus lacus nec ligula. Aenean vel metus. Nunc mattis lorem posuere felis. In vehicula tempus lacus. Phasellus arcu. Nam ut arcu. Duis eget elit id eros adipiscing dignissim. | NUMBER | The number defined here will be the offset in days. Negative values are used to substract days. Internally JWT multiplies this value with the time macro |
timeZone | TIMEZONE | The time zone used for the calculation. |
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.
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 a JWT calculated date-time field.
Variant of the function where you can define the start and the end of the weekend .
This function is useful when the non-working days differ from the standard (Saturday/Sunday).
addDaysSkippingWeekends(timestamp, numberOfDays, timeZone, startOfWeekend, endOfWeekend) #Output: Number
Parser expression | Description |
---|---|
addDaysSkippingWeekends({issue.duedate}, 10, LOCAL, {FRIDAY}, {SATURDAY}) | This function adds 10 working days to the TIMESTAMP of the issue due date. Fridays and Saturdays are not counted. |
addDaysSkippingWeekends({issue.duedate}, -2, LOCAL, {SUNDAY}, {TUESDAY}) | This function substracts 2 working days to the TIMESTAMP of the issue due date. Sundays, Mondays and Tuesdays are not counted. |
Parameters used in this function
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). |
numberOfDays | NUMBER | The number defined here will be the offset in days. Negative values are used to substract days. Internally JWT multiplies this value with the time macro |
timeZone | TIMEZONE | The time zone used for the calculation. |
startOfWeekend | NUMBER | The parameter will take values in the format of {MONDAY},{TUESDAY} ...{SUNDAY} |
endOfWeekend | NUMBER | The parameter will take values in the format of {MONDAY},{TUESDAY} ...{SUNDAY} |
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.
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 a JWT calculated date-time field.