Hello everyone,
I'm building an automation rule to calculate a progress percentage at the Story and Epic level based on a custom field called Business Points from child tickets. The Business Points are weighted as follows:
The calculation I need to perform is:
(Sum of weights for children with status "Demo" or more advanced / Sum of weights for all children) * 100
My automation rule follows these steps:
1 - Trigger: When a Story’s status or Business Points change.
2 - Condition: Check that the issue is a Story.
3 - Retrieve Epic Parent: Get the parent Epic of the Story.
4 - Lookup Issues: Use a JQL query to retrieve all child Stories with:
"Epic Link" = {{parent}} AND issuetype = Story
5 - For JQL Branch: Iterate over the parent’s children.
6 - Extract Business Points:
I create a variable (let’s call it businessPointsList
) that collects the Business Points from each child by extracting the numeric value before the "-" using:
{{#lookupIssues}}{{fields.customfield_12006.value.split("-").first}}{{^last}}, {{/}}{{/lookupIssues}}
7 - This displays correctly in my log, for example:
Business Points Log Display :1, 3, 4
Problem:
My goal is to sum the elements of this list to calculate the overall progress percentage, but I’m unable to perform the sum directly on businessPointsList
using Jira Automation smart values.
Has anyone managed to sum the elements of a list (which in my case contains only numeric values) within Jira Automation? Are there any workarounds or best practices to accumulate a total from a list of smart values?
Any help or suggestions would be greatly appreciated!
Thank you in advance.
You appear to be using Jira Server / Data Center. Is that correct? If so, the Lookup Issues action for those versions of automation do not contain custom fields yet: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877
As you want to update a field based on the sum of fields, the REST API must be used with the Send Web Request action rather than using Lookup Issues. Please see this post describing that approach:
Kind regards,
Bill
You can refer to this link which shows how to sum values.
see if this helps you move forward
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.