How can I group lookupIssues results by component, and take the size of the largest group?

Aidan Follestad
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!
November 27, 2023

The main objective is that I want to sum points for tickets in an epic, and assign that to the epic Story Points field.

However, my project uses components to separate tickets by platform… I want to take the sum of the platform that has the most overall points, and assign that to the epic.

Basically, I want to use lookupIssues, group the results by component, and use `MAX()` to get the largest sum. But the aggregation part has proven difficult to figure out!

2 answers

1 accepted

1 vote
Answer accepted
Tim C
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.
November 27, 2023

Hi @Aidan Follestad 

Welcome to the Atlassian community.

I don't know how many components you've got - but here's one potential approach if it's a manageable number ...

Do a lookup using JQL for the data sets for each of your components and create a smart variable for each total of story points - e.g.  ....

Lookup issues based on JQL #1 ...
"project = XYZ and component = ABC and "story points" is not empty"
+ Create variable LUA = {{lookupIssues.story points.sum}}

Lookup issues based on JQL #2 ...
"project = XYZ and component = DEF and "story points" is not empty"
+ Create variable LUB = {{lookupIssues.story points.sum}}

Lookup issues based on JQL #3 ...
"project = XYZ and component = GHI and "story points" is not empty"
+ Create variable LUC = {{lookupIssues.story points.sum}}

You can then find the maximum from each of the smart value variables ...

create variable MyMAX = max(LUA, LUB, LUC)

Then you'd edit the Story points value for the required Epic and add the MyMAX variable.

Obviously, someone else may have a smarter solution - but hopefully this helps.

Thanks,

Tim C

Aidan Follestad
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!
November 27, 2023

That does indeed work, thanks @Tim C

I do wish there was a more "future proof" way to do it so it doesn't have to be maintained quite as closely if new components were added or something. 😁

0 votes
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.
November 27, 2023

Hi @Aidan Follestad -- Welcome to the Atlassian Community!

Have you considered having different epics (and so with different component values) for each platform?  That would eliminate the need to determine the maximum sizing / sum by platform.

Without knowing your Jira version (Cloud, Server, or Data Center) I wonder if you could relate the platform-scope items with other issues using the hierarchy or linkages.  For example with Jira Cloud, using Ideas in Jira Product Discovery (JPD) to span them.

If not...

A variation of the approach suggested by Tim is to use a single call to Lookup Issues to gather the stories, and then use smart value, list filtering to build a Lookup Table, with one row for each component possible.  The only maintenance would be to add / remove rows from the table when components change.  The rule itself would only be a few steps (5-6).  If you are interested in learning more about that approach, please let me know.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events