The businessAdd filter adds a specific number of days to a date, skipping non-business days, where non-business days mean Saturday and Sunday. This article provides the code snippet to add a given number of days to date by skipping the specified weekdays.

Instructions

  1. Navigate to the desired workflow transition and add the “Set issue fields (JMWE app)” post-function.

  2. Select the target issue, target field and add the below template in Value :

    {% set startDate = issue.fields.customfield_10057 %}
    {% set nod = issue.fields.customfield_10055 %}
    {%set endDate = startDate %}
    {% for n in range(0, nod) %}
    {%set endDate = endDate | date('add' , 1 , 'days') | date %}
    {% set day = endDate | date('e') %}
    {% if day == 5 %}
    {%set endDate = endDate | date('add' , 2 , 'days') | date %}
    {% elif day == 6 %}
    {%set endDate = endDate | date('add' , 1 , 'days') | date %}
    {% endif %}
    {% endfor %}
    {{endDate}}

Replace :

In the above template, we’re considering Friday (line #7) and Saturday (line #9) as non-working days. Modify them as per your use case (refer to this page)

References