Automation to fill due date according to original estimate

Vitor Hugo Campos Lage
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!
February 10, 2025

Hello there! 

I've been trying for a couple hours to create an automation to fill the due date field with the sum of the current day and the originalEstimate, but have not been successful.

I've tried to create a varieble called estimatedDays 

{ "fields": { "estimatedDays": "{{#if(issue.OriginalEstimate)}}{{math.floor(issue.OriginalEstimate / 28800)}}{{/if}}" } }

and then updating the due date field with 
{ "fields": { "duedate": "{{now.plusBusinessDays(estimatedDays).format('yyyy-MM-dd')}}" } }

and many different ways, but none of them worked... 
Can anyone help?

1 answer

0 votes
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.
February 10, 2025

Hi @Vitor Hugo Campos Lage -- Welcome to the Atlassian Community!

For a question like this, context is important for the community to help.  Please post the following:

  • an image of your complete automation rule in a single image for continuity,
  • images of any relevant actions / conditions / branches,
  • an image of the audit log details showing the rule execution, and
  • explain what is not working as expected and why you believe that to be the case.

Until we see those...

The originalEstimate smart value is the human-readable one.  Please instead use this one:

{{issue.timetracking.originalEstimateSeconds}}

Next, your syntax for creating the variable with a math expression is incorrect.  Perhaps try this:

  • action: create variable
    • name: varEstimatedDays
    • value:
{{#=}}FLOOR(0{{issue.timetracking.originalEstimateSeconds}} / 28800){{/}}

I put a 0 at the front to work as a default value in case the field is empty.

 

Finally, created variables are text, and so must be converted with asNumber for use as a parameter to plusBusinessDays().

 

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events