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

Compare with Current View Page History

« Previous Version 13 Current »

On this page

Use case

Add three days to a Date picker from the date that you prefer. For demonstration purposes, we are going to use the current date.



Configuration

Add the post function Update fields to the transition of your choice.

Target issue*

Select current issue or parent of current issue, and upon selecting: 

  • Selected issue - An issue must be selected from your current issue list.
  • Parser expression - A valid expression must be entered, to learn more about expressions visit JWT expression editor.

Fields

Field*

Choose a date field, e.g., Date picker, Planned end date, Planned start date, Due date...etc.
In this example, we will consider Due date as our date field.

Value*

Select Set field value manually (parser expression) and enter the following expression:

%{dayOfTheWeek({system.currentDateTime},RUN_AS_LOCAL) in [3,4,5] ? 	
dateTimeToString(addDays({issue.dueDate}, 5, RUN_AS_LOCAL), "YYYY-MM-DD", RUN_AS_LANG) : dateTimeToString(addDays({issue.dueDate}, 3, RUN_AS_LOCAL), "YYYY-MM-DD", RUN_AS_LANG)}

With minor modifications, you will be able to add up to 5 days to any date skipping weekends as long as you increase or reduce the count in [3,4,5] for every unit added or deducted respectively from the number of days that you would like to skip and also increase or reduce the values of the number 5 by an unit.

For instance, adding 4 days instead of 3 would suppose adding a unit to 3 and 5 (4 and 6 after the change) and adding another number to the number list (it would become [2,3,4,5]).




If you still have questions, feel free to refer to our support team.