Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to add value from "remaining estimate" to date in "smart values" in automation ?

lukasz_skurczynski
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 6, 2024

Hi, 

 

I tried to solve my problem in 2 methods, but none of them works for me. 

 

Problem definition: 

Based on Start Date and Remaining Estimate fill value for End Date using only bussiness days for calculation. 

 

Start Date and End Date - are custom fields in my jira, i know IDs of those two. 

 

I stuck on reading date and translating it to number value to do math in smart value automation.

 

I tried this: 

Edit Issue (action) 

modify field - End Date:

formula:

{{#=}}{{issue.field.customField_ID(start_date)}} + ( {{issue.timetracking.timeSpentSeconds}} / 28800)}} ){{/}}

 

or:

Edit Issue (action)

modify field - Start Date: 

set: {{now.toBusinessDay()}}

modify field - End Date:

formula:

{{now.plusDays({{issue.timetracking.timeSpentDays}}).toBusinessDay()}}

 

Is anyone here who can solve that issue for me ? 

Regards

Luke

1 answer

1 accepted

1 vote
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.
February 6, 2024

Hi @lukasz_skurczynski -- Welcome to the Atlassian Community!

First thing, is "End Date" a custom field or do you instead mean the "Due date" field?

You are on the correct path with your second example: to increment a date value, use the plus functions in a rule: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-plus-unit---

The values passed to the functions like plusDays() must be a number, so first confirm you have your values correct by writing them to the audit log.

For your specific scenario, you do not describe under what conditions you will use the Remaining Estimate to increment the Start date value.  This is relevant as the remaining will decrease over time, and so pick a "baseline" point.

You also do not state if the final value of "End Date" should be a business day.  (The increments could make it fall on a weekend.)  If it needs to be a business day, add the toBusinessDay function to do so.  https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Next-business-day---

{{issue.Start date.plusBusinessDays(issue.timetracking.remainingEstimateSeconds.divide(28800)).toBusinessDay}}

 

Kind regards,
Bill

lukasz_skurczynski
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 7, 2024

Thank you for quick reply ! 

function works as intended. 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events