Forums

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

Remaining Estimate + Time Spent using automation

rob_jeal August 17, 2023

Hi,

I am looking to create 2 custom fields which would be the following:

Estimate at Completion = Remaining Estimate + Time Spent/Logged

Variance = Estimate at Completion - Original Estimate

I've previously done this using JMCF at a previous employer but now trying to see if it can be done using automation? 

Thanks

1 answer

0 votes
Marc - Devoteam
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.
August 17, 2023

Hi @rob_jeal

You can use mathematical expressions in automation.

In formation on who to use them can be found here:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/ 

rob_jeal August 17, 2023

Thanks @Marc - Devoteam . I am getting success in the audit log but then the field is still showing None, do you have any idea why this might be sorry? This is what I have inputted in the "edit issues" section of the automation. The field it is populating is a custom number field "estimate at completion"

{{#=}}{{issue.fields.timetracking.remaining estimate.plus(issue.fields.timetracking.timeSpent)}}{{/}}

Marc - Devoteam
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.
August 18, 2023

Hi @rob_jeal 

I see there is a slight mistake in you mathematical expression.

I think it should be like this:

{{#=}}{{issue.fields.timetracking.remaining estimate}} +{{(issue.fields.timetracking.timeSpent)}}{{/}}

rob_jeal August 18, 2023

Thanks again @Marc - Devoteam . I tried your expression and got the following in audit - Failed to get value for (issue.fields.timetracking.timeSpent): {{#=}}{{issue.fields.timetracking.remaining estimate}} +{{(issue.fields.timetracking.timeSpent)}}{{/}}

I removed the 2 normal brackets from the timeSpent part of the expression and am now getting the following:

Too many numbers or variables: +0m 

I am guessing this relates to the timeSpent field as I only changed the remaining estimate, whereas when I added 2hrs to time spent I got the same "too many numbers or variables" message but "+2h" instead of "+0m" . 

It is a custom "number" field I am trying to populate as couldn't find a more appropriate field type.

Marc - Devoteam
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.
August 18, 2023

Hi @rob_jeal 

I think the issue is that math functions rely on number fields, the time fields in Jira are probably not recognised as number fields in Jira.

So we might think differently.

{{#=}}{{issue.timetracking.remainingestimateSeconds.divide(3600).round}} + {{issue.fields.timetracking.timeSpentSeconds.divide(3600).round}}{{/}}

rob_jeal August 18, 2023

That's great @Marc - Devoteam thank you that has worked now.. I was hoping the result could be to 2 decimals (currently no decimals). I've removed the .round to see if that helps but still the result has no decimals.. Sorry last hurdle hopefully and then we're good!!

Suggest an answer

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

Atlassian Community Events