You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

This function adds or subtracts time to/from any given date.

Weekends will not be counted as working days.

Syntax
addTimeSkippingWeekends(timestamp, timeToBeAdded, timeZone) #Output: Number
Examples
Parser expressionDescription
addTimeSkippingWeekends({issue.duedate}, 1 * {MONTH} + 2 * {HOUR}, LOCAL)

This function adds 1 month and 2 hours to the issue's due date.

Weekends won't be taken into account.

addTimeSkippingWeekends({issue.created}, 3 * {DAY} + 1 * {HOUR}, LOCAL)

This function adds 3 days and 1 hour to the issue's creation date.

Weekends won't be taken into account.

addTimeSkippingWeekends({issue.duedate}, - 1 * {YEAR}, LOCAL)

This function subtracts 1 year from the issue's due date.

Weekends won't be taken into account.

Additional information

Parameters used in this function

ParameterInput (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).
timeToBeAdded

NUMBER

The number defined here will be the offset of time. The offset can be built with the different time macros. Learn more about time macros.

Negative values are used to subtract time.

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. 

Output

The function returns a NUMBER with the difference that weekends do not count in the sum.

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

Another very common use case is to use this function in a JWT calculated date-time field.

If you want to convert the number into a string, you might want to take a look at the dateTimeToString() function.


The function returns a NUMBER with a custom defined weekend.
beginning_of_weekend and end_of_weekend take the following values : {MONDAY} , {TUESDAY} ... {SUNDAY}.

Syntax
addTimeSkippingWeekends(timestamp, timeToBeAdded, timeZone, startOfWeekend, endOfWeekend) #Output: Number
Examples
Parser expressionDescription


addTimeSkippingWeekends({system.currentDateTime}, 12 * {HOUR}, LOCAL, {FRIDAY}, {SATURDAY})

This function adds 12 hours to the current date and time.

Fridays and Saturdays are not counted.

addTimeSkippingWeekends({system.currentDateTime}, -2 * {DAY}, LOCAL, {SATURDAY}, {SUNDAY})

This function subtracts 2 days from the current date and time.

Saturdays and Sundays are not counted.

Additional information

Parameters used in this function

ParameterInput (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  {DAY} to add full days to the timestamp. Learn more about time macros.

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. 

Output

The function returns a NUMBER with a custom defined weekend and the difference that weekends do not count in the sum.

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

Another very common use case is to use this function in a JWT calculated date-time field.

If you want to convert the number into a string, you might want to take a look at the dateTimeToString() function.