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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.