Add # of business days to "Due Date" based on "diff"

Konstantine Shengelia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 25, 2023

Hi,

I am using this:

{{issue.duedate.plusDays(fieldChange.from.toDate.diff(fieldChange.to.toDate).days).toBusinessDay}}

 Which does almost what I need:

  1. I update "Start date" by adding 3 days for example
  2. It updates "Due date" with same number of 3 days and then finds next business day after that

So, for example:

  • Task takes 2 days
  • It starts on Tuesday and ends on Thursday
  • If I change Tuesday to Wednesday, then Thursday changes to Friday, which is good

But

  • If I change Tuesday to next Monday, it counts not business days but whole 6 days (including weekend) and adds that to Due date.

So, I am trying to integrate "businessDays" smart value in these formula. Essentially:

  1. See how many business days was added to Start date
  2. Add same number of business days to Due date

Is that possible? Thanks

1 answer

0 votes
Oday Rafeh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2023

Hi @Konstantine Shengelia , 

Yes, it's possible to add the number of business days to the due date based on the "diff" between the start and end dates. Here's the modified formula:

{{issue.duedate.plusBusinessDays(fieldChange.from.toDate.businessDaysUntil(fieldChange.to.toDate)).toBusinessDay}}

This will calculate the number of business days between the start and end dates and add the same number of business days to the due date.

Regards

Oday

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events