Date difference in working days

Rakesh Pradhan April 11, 2024

Hi All 

I have created an automation which calculates the difference in days  between the baseline Date and Due Date when a project milestone due date is moved.  

 

i have used the following inthe automation step

{{issue.Due date.diff(Baseline End Date).days}}

This outputs into a custom field with a number - however this only calculate the total days difference not the working days 

 

Can anyone tell me how to create or amend the automation script to calculate as working days ?

 

regards

Rakesh

 

 

1 answer

1 accepted

3 votes
Answer accepted
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 11, 2024

Hi @Rakesh Pradhan , you should qualify by using "businessdays". Here is an excerpt from the documentation...

Date difference {{[date1].diff([date2]).[unit]}}

Returns the amount of time between date1 and date2, in the unit specified. If date2 is earlier than date1, the value returned will be negative.

The units that can be used with this smart value are:

  • millis

  • seconds

  • minutes

  • hours

  • days

  • weeks

  • months

  • years

  • businessDays

You can also change the format of the output using the following:

  • prettyPrint - displays the difference in words, e.g.: 2 days 3 hours.

  • abs - returns the value as a positive number.

Rakesh Pradhan April 11, 2024

thanks !!! Worked

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events