For better capacity planning we introduced the custom fields "FE-Estimates" and "BE-Estimates".
Both are numeric fields.
So now I want to sum all values from all stories into the same custom field within an Epic.
How can I do that?
I tried the following but it's not working
Hello, community!
As noted in the other answers for this question, summing custom fields with Jira Cloud may use the Lookup Issues action: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues
However for Jira Server and Data Center, the initial version of Lookup Issues does not support all fields yet. Please watch / vote here to see progress on that work: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877
The work-arounds for Server and Data Center versions depend upon what you want to do with the sum value(s):
Using that second method, a custom field is summed like this:
{{webhookResponse.body.issues.fields.customfield_12345.sum}}
If you run into problems, remember to write the response body to the audit log and confirm you have the correct smart values for your fields.
Kind regards,
Bill
Excellent write up Bill. This is sure to help others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just spent few hours trying to implement Bill Sheboy second proposal, and finally success! Hope this post will help someone to save time:
No rocket science, but you have to be very careful about parameter names and such.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Timur Khakimyanov -- Welcome to the Atlassian Community, and well done!
The part I find interesting about your web request, custom data is passing the entire {{lookupIsssues}} smart value rather than parsing the keys/id values out into a CSV list, such as: {{#lookupIssues}}{{key}}{{^last}},{{/}}{{/}}
Looks like your version works for you, and so meets the goal!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You cannot sum values across all stories. The automation math functions work within an issue. So you can sum two numeric fields within an issue. You might need to look at some add-on for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Andreas Safar -- Welcome to the Atlassian Community!
Yes, and...to what Jack noted: Are you using the Server or the Cloud version?
I note you are trying to sum custom field values with Lookup Issues.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply. We are using the cloud version.
In other threads I saw comments where the story points or time estimates are summed up in the appropriate fields of their epic. So I was hoping to do the same just with the custom fields. Something like this:
Story 1 has value '5' in custom field
Story 2 gets a '3' entered into the custom field
Both stories are linked to the same epic
-> custom field within the epic gets updated from '5' to '8'
and so on when the custom field is set/changed/removed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andreas you cannot sum on custom fields with Lookup Issues in an automation rule, yet...
Two possible work-arounds are:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill, thank you again for your support. I've voted for JRACLOUD-75018
I'll try to handle it with the proposed work-arounds.
Just for your reference in the meantime I've tried the following:
With the following rules the custom field on the parent issue is changing from NULL to 0
see the history:
I'm getting the same effect with
{{lookupIssues.customfield_10066.sum}}
{{Issues.customfield_10066.sum}}
{{lookupIssues.fields.customfield_10066.sum}}
{{Issues.fields.customfield_10066.sum}}
{{lookupIssues.subtasks.fields.customfield_10066.sum}}
where the following has no impact on the epic issue
{{Issues.subtasks.fields.customfield_10066.sum}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup... {{issues}} (note the plural) is a Server version smart value used in conjunction with that batch/scheduled trigger I noted. It doesn't work for Cloud version.
The equivalent for Cloud version batch processing is Lookup Issues...and that feature does not support custom fields.
Please see the two work-around ideas I offered to see if one of those will work for you. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Custom fields are now supported in Lookup Issues: https://community.atlassian.com/t5/Automation-articles/New-lookup-issues-fields/ba-p/1873978
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This issue was resolved long ago for Jira Cloud, but still exists for Jira Server / Data Center automation rules. I am curious, what is the purpose of your post?
Thanks, and kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
I've just stumbled upon this limitation on DC. Regarding possible workarounds you've mentioned, particularly 2nd method - how can you convert the webhook response to a list? I've sent a REST API web request (JQL) and got several issues as a result there. With that (response), how can you convert that to a list and use list.sum function?
On webhook response, I've tried {{webhookResponse.issues.customfield_XYZ.sum}} but that ain't working 👀
Cheers,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are quite close to the answer...It helps to post the entire response to the audit log and confirm the response structure as that will show using both the body and fields to get at the data.
{{webResponse.body.issues.fields.customfield_12345.sum}}
That works for me for Jira Cloud, so please confirm it for your Data Center rule.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're a lifesaver @Bill Sheboy 😄
I've been struggling with web response as there's only one browser I can use in this specific environment and it doesn't format JSON response automatically (+all online formatters are also restricted by network security policy).
Anyway, I've tested it on this DC environment and it works perfectly! The only difference is that webhook responses are accessible via
{{webhookResponse}}
while on cloud it is
{{webResponse}}
Cheers,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy , it might be worthwhile pulling out the details of the answer into a separate answer and then @Tomislav Tobijas or I could accept it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.