Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need help with a Structure formula expr to sum unique issuelinks types

Chris Lee April 18, 2024

For a given issue, I want a structure formula column to display the total for each of the different issuelinks.type for that issue. Basically the equivalent of a UNIQUE_COUNT.

I can use  UNIQUE(issuelinks.type) to see the different types. Now I need a sum of each. I've tried various ways with SIZE() but can't figure it out.

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Stepan Kholodov _Tempo_
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.
April 19, 2024

Hello @Chris Lee 

You can try a formula like this:

with abc = issuelinks.filter($.type="blocks").size():
with def = issuelinks.filter($.type="implements").size():
array(abc,def)

At the top, you would need to define all link types that you want to count, and the formula will show if an issue have any of them. 

I hope this helps. If you need further assistance or have other questions about Structure, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

Chris Lee April 29, 2024

Thanks. I had this brute force method in place but was hoping for something more elegant and dynamic where I could pull all types into an array, iterate over that array, and pull the sums/counts of total issues of each type. 

Chris Lee April 29, 2024

This is what I came up with and it works (hooray):

 

WITH aa2 = (issueLinks.type.inward).UNIQUE():
WITH seq1 = SEQUENCE(0, aa2.SIZE()):
WITH totaltype(arr, idx) = GET(arr, idx) CONCAT ": " CONCAT SIZE(issuelinks.FILTER($.type.inward = GET(arr, idx))):
seq1.MAP(totaltype(aa2, $)) CONCAT ", "

Like Stepan Kholodov _Tempo_ likes this
TAGS
AUG Leaders

Atlassian Community Events