How to setup an automation with 2 date fields sum?

Vitor Seabra March 20, 2023

Hello there! I'm setting up a new automation but I have no clue on how to make it works using Jira Smart Values.

What I basically need is to sum the Original Estimation field value (i.e: 2w) with the Start date value (i.e: March 20, 2023) taking in consideration business days (i.e: 2w = 10 b.d) so the result would be the Due date value (ex: March 31, 2023).

 

Does anyone could help me out with the right expression?

 

Thank you in advance.

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
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 20, 2023

Hi @Vitor Seabra -- Welcome to the Atlassian Community!

I believe the Original Estimate is stored as seconds, and so if you divide that value (based on your site settings for work days/hours) into whole days, it can be added to your field with plusBusinessDays()

{{issue.yourField.plusBusinessDays(yourIncrementValue)}}

Kind regards,
Bill

Vitor Seabra March 21, 2023

Thank you Bill!

Just one further question: My Start Date field name is customfield_10015 (which is weird, once I thought it was a native field). The Original Estimate field name is timeoriginalestimate. So the proper expression for this formula would be:

{{issue.customfield_10015.plusBusinessDays(timeoriginalestimate)}} ?

Bill Sheboy
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 21, 2023

You will need to divide the estimate value to convert seconds to working days first:

60 seconds/minute x 60 minutes/hour x 8 hours/work day = 28,800 seconds/work day

{{issue.customfield_10015.plusBusinessDays(issue.timeoriginalestimate.divide(28800))}}
Like Vitor Seabra likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events