Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,948
Community Members
 
Community Events
168
Community Groups

ALM Structure Formula: Count unique assignees of children

Hi there-

I am trying to use a Formula column to display the number of unique assignees in the children of a folder. 

For example, if there are 3 children tasks under folder, 2 of which are assigned to John and 1 is assigned to Jane, I would like the Formula to display: 2.

I can get the unique assignees successfully as text values with this....

IF type = "epic" OR type = "story" :
VALUES#children { assignee.UNIQUE() }

But I am struggling to find a way to display the above as just a number. I have tried just replacing VALUES in the above formula with COUNT but then the number displayed stops showing me 'unique' and only shows me a total. 

Thoughts on how I can achieve this? I'm sure it mustn't be that hard but I am still very new to using this formula language.

1 answer

1 accepted

1 vote
Answer accepted

Hi Kota,

Your code is really close, you just need to add the size function, to return the number of occurrences, instead of the unique list of assignees, like this:

IF type = "epic" OR type = "story" :
VALUES#children { assignee }.unique().size()

Please let me know if you have any other questions.

Cheers,
Nick [ALM Works]

Wow close indeed! Thank you @Nicholas Ellis _ALM Works_ !

I do have one more question, do you know how to alter this formula to include the sum of all nested children? 

Below is an example of the result I am getting - as you can see the column is showing the sum of children but only 1 level deep.

formula.png

Hi Kota,

This is actually really easy.  All you need to do is change #children to #subtree.  The children modifier means only direct children (i.e. one level below).  The subtree modifier will search the entire subtree (i.e. all levels below).  Here is the documentation if you are interested to learn more.

Cheers,
Nick [ALM Works]

Like David Niro _ALM Works_ likes this

Oh awesome :) Ty so much, this has helped me understand the language a lot more!

After trying #subtree, I experimented around with different modifiers in the documentation and found that #leaves is even better for my use case. With how my Structure is designed, #leaves will sum Assignees at the task level and exclude the parent level Epic/Story owners from the count, but still show the right count all the way back to the top of the hierarchy. So per my image example above, using #leaves, the value I am getting at the top Epic level is 2. 😍 

Super helpful, thanks again!

Like David Niro _ALM Works_ likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,046 views 18 32
Read article

Atlassian Community Events