S-JQL filter to remove unwanted issue types depending on parent type from structure

Hannes Nanninga June 25, 2024

Hi,

I'm part of a larger organization with several Jira projects, each with thousands of issues and many custom types. As you can imagine, the data quality is sometimes poor.

I'm looking to create a structure (i. e., the Structure extension from tempo) that is lenient towards the different link and issue types but strict in its presentation. We have three custom issue types that interest me; they are supposed to be in this hierarchy:

  • Goal
    • Bet
      • Initiative

People are using random link types to link them to each other, so I have to be very lenient with my Extend-Generators. There are also a lot of random links between the issues, e. g. Goals linking to other Goals or Initiatives linking back to Bets, which they shouldn't.

I want the structure to only display the issues in the hierarchy above. There is one exception; the structure should also show orphaned Bets. This makes it more difficult because it means I can't simply filter issues by type and apply the filter only to a certain level. That's why I tried a S-JQL filter.

The Insert Generators (JQL) looks something like this:

issuetype = Goal
OR issuetype = Bet // To insert orphaned Bets

The S-JQL filter:

(
[type = Bet] and parent in [type = Goal] // Show Bets whose parents are Goals
or
[type = Initiative] and parent in [type = Bet] // Show Initiatives whose parents are Bets
)
and parent not in [type = Initiative] // The structure should not go deeper than these 3 levels

It doesn't work. The structure still shows random Bets as children of other Bets and such. I suppose I'm not using the filter right but the documentation is pretty theoretical and I couldn't figure it out.

What can I do show the issues only in the correct hierarchy?

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Stepan Kholodov _Tempo_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 26, 2024

Hello @Hannes Nanninga 

The S-JQL functionality allows to additionally reference not just the values of issues, but their connections with other issues through the hierarchy. Important detail here: the hierarchy in question should exist in the structure. i.e., if you want to reference a parent-child relationship, the two issues should be present in the structure, one below the other as its sub-issue. S-JQL doesn't consider links in Jira, it only takes into account what is presented locally in the structure.

In your case, to apply any hierarchy-based filter, first, the relationships between issues have to be visualized: all issues must be added to the structure and organized according to how they relate to each other. Goals and orphaned Bets should be added to the top level, linked Bets should appear under their Goals, and linked Initiatives should appear under their Bets. Only after that, any filtration can happen.

Here is what you can try:

1. Add Goals and Bets by an inserter.
2. Use the Linked Issues Extend generator to add linked Bets under Goals. An extender works with a single link at a time; ideally, all Goals and Bets would be connected with (at least) one type of a link, so using this link would get all sub-issues in the structure. 
3. Use another extender for adding linked Initiatives selecting a link type that connects them with Bets. 
4. Add the Remove Inserter/Extender Duplicates filter to remove the duplicated Bets(those that have parent Goals) from the top level.

But if there is not a single link that connects 1 with 2, and 2 with 3 levels of the hierarchy, you would need to use multiple extenders or to perform some sort of a clean up in Jira to change the existing links between issues. Structure can visualize what is already existing in Jira and there are many ways to visualize only specific relationship, but it might not be possible to achieve what you need if the links created by users are too inconsistent.

I hope this helps. If you need further assistance or if you have other questions about Structure, please reach out to us at our support portal and we'll get back to you shortly.

Best regards,
Stepan
Tempo (the Structure app vendor)

Hannes Nanninga June 27, 2024

Hi Stepan,

thank you for your answer!

I figured it out. The filter matches the respective issues and their ancestors so that's why I got weird results. One has to be very specific to match each item type and their position in the structure. My filter now works and looks like this:

[type = Goal] and root

or

[type = Bet] and root

or

[type = Bet] and child of root and child of [type = Goal]

or

[type = Initiative] and child of [type = Bet] and child of child of [type = Goal] and child of child of root

or

[type = Initiative] and child of [type = Bet] and child of root

Not the most elegant perhaps, but it's what I need.

Best,

Hannes

Like Stepan Kholodov _Tempo_ likes this
0 votes
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 25, 2024

Hello, @Hannes Nanninga. Welcome to the Atlaissian Community 👋

Because you are using Structure from Tempo, I moved your post here to App Central, which is the right place to post questions about Atlassian Marketplace products.

I also added a couple of additional tags to your post to help draw the right eyeballs to it. 

The Structure support team is good about keeping an eye out for Structure things here, but the extra tags will help.

Best,

-dave

Hannes Nanninga June 25, 2024

Thanks Dave!

TAGS
AUG Leaders

Atlassian Community Events