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
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/
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)}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.