Features used to implement the example



Example: Set "Due date" 6 natural days (or work days) earlier than a "Date Picker" custom field

I tried to use the substractDays. function and it does not work. The due date stays empty. I tries 6 * {DAY}, I am not sure if it is the good way. Actually, on the creation, I want to push the value "Ship date - 6 days" to "Due date".

In case you want to subtract 6 natural days from "Due Date", you have to use post-function Mathematical and date-time expression calculator with the following configuration:

 

Notice that:

  • {12200} is the code for numeric value of field "Ship Date". This code depends on each Jira instance.

Once configured, transition "Create Issue" will look like this:

 

Alternative implementation

In case you want to subtract work days from "Due Date", you have to use post-function Mathematical and date-time expression calculator with the following configuration:


Note that:

  • {12200} is the code for numeric value of field "Ship Date". This code depends on each Jira instance.
  • Work days depend on timezone, since certain moment in time may be Sunday in some timezones, and Monday in other ones. In the example we are using Jira server's local time, but we can use any other timezone. If you want to use the current user's time zone you should use USER_LOCAL instead.

Once configured, transition "Create Issue" will look like this:



Since version 2.2.39, Jira Workflow Toolbox supports Custom Schedules, and you can do all you are doing now using addTimeSkippingWeekends() and subtractDatesSkippingWeekends() functions, and much more.



Other examples of that function



Related Usage Examples