Group By based on a formula where issues may be returned in multiple segments

etienne Borella April 11, 2021

Hi

We use Structure on Jira Datacenter. We have a lot of labels on issues for tagging all sorts of dimensions (frameworks, middlewares, OS, application ownership, cmdb ref #…etc). I’d like to add to a Structure with  « Group By » quick transformations for each dimension by using a formula.

As an example, let’s say I have 3 issues :

  • Issue A : labels Windows2012, Websphere, UnitA and others
  • Issue B : labels Windows2016, Weblogic, UnitB and others
  • Issue C : labels Windows2012, Windows2016, Weblogic, UnitA and others

I’d like to add a quick transformation « Group By windows version », so I created a group by transformation based on the formula IF(SEARCH("Windows2012", labels), "Windows 2012", SEARCH("Domino2016", labels), "Windows 2016").

The result is :

  • Folder « Windows 2012 »
    • Issue A
    • Issue C
  • Folder « Windows 2016 »
    • Issue B

But , since Issue C contains both Windows2012 and Windows2016 labels, I’d like this issue to appear under both folders:

  • Folder « Windows 2012 »
    • Issue A
    • Issue C
  • Folder « Windows 2016 »
    • Issue B
    • Issue C

Is there a way to do so when using group by based on a formula?

Thanks for your help

1 answer

1 accepted

0 votes
Answer accepted
Nicholas Ellis _ALM Works_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 12, 2021

Hi Etienne,

Your assessment is correct this is they way that it works currently.  Unfortunately there is not a good way to handle this with formula groups.  The problem is a labels field returns multiple values so the issues go into multiple groups, but a formula can only return a single value.

The good news is there are alternative options.

1. You could make a structure with multiple folders and in each folder have an insert JQL like: labels = "windows 2012", for each label you want to include.  This will still result in duplicates showing up once in each group.

2. If you can wait there will be a much nicer way to handle this with the next version of EXPR.  We expect EXPR 2.0 to be available later this year, and it will have array support which should make this a trivial formula to write.

Please let me know if you have any further questions.

Best,

Nick Ellis

[ALM Works]

M_ Ga July 12, 2022

Hi Nick

I just found this entry and have the same issue as Etienne but in the meantime we've got Structure 7.2.0 which we could use EXPR 2.0. 

Could you explain how you would write the Array based on Etienne's use case?

Thanks

Marcel

Nicholas Ellis _ALM Works_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 12, 2022

Hi Marcel,

This is pretty straight forward in Expr 2.  You just check the list of labels against an array of items you are looking for like so:

labels.FILTER(
  ARRAY("Windows 2012", "Windows 2016")
  .contains($)
)

Then you can group by this formula using the attribute grouper.  Attribute grouper documentation.

Cheers,
Nick

Like Devender Singh likes this
M_ Ga July 13, 2022

Hi Nick,

Works like a charm :) thank you!

Cheers

Marcel

Suggest an answer

Log in or Sign up to answer