Filter LinkedIssues within LinkedIssues
Asked by GiorgosTsav:

Hi Community.

I have this :

![fi.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/340750iDDB15AC41007E0CD/image-size/large?v=v2&px=999 "fi.jpg")

Is it possible to fetch the bugs related to test?


Answers:
author: Trudy Claspill
body: Hello [@GiorgosTsav](/t5/user/viewprofilepage/user-id/4735876)

Can you provide more information?

Is the filter you showed not giving you what you want? If so, can you provide details?

- Is it giving you issue that you don't want?

- Is it not giving you the issues that you do want?

If you simply want Bug issues that are linked to Test issue you would use a very similar filter:

issueType=Bug and issueFunction in linkedIssuesOf("issuetype=Test")

comments: author: GiorgosTsav
body: Feature is tested, in case the QA team finds a Bug, then a type Bug issue is created and assigned to DEV within the Test.

So the "hierarchy" is something like : Feature -\> Test -\> Bug (whenever is needed)


author: Trudy Claspill
body: Let me check if I understand your goal.

Based on the first query you provided you want to get all the Features, Product Miss, and Customer requests that are linked to Tests. In addition you want to get all the Bugs linked to the same Tests.

Do I have that correct?

Do you also want to include the Test issues in your results?

Jira does not have a method available to display those results in a hierarchy. Issue linking allows issues to be linked to multiple issues, and that is not a structure that can be displayed in a simple hierarchy.

If you have a Jira subscription that includes Advanced Roadmaps Plans then you could display the results as a dependency tree, possibly.


author: GiorgosTsav
body: Let's put aside the word hierarchy. I do have this -\> issuetype in (Feature, "Product Miss") AND issueFunction in linkedIssuesOf("type = test"). There are 2 scenarios :

1. Test = passed. All good.

2. Test = Failed. The QA team finds a bug. As a result an issue type of Bug will be created.

So what i want to achieve is the above : issuetype in (Feature, "Product Miss") AND issueFunction in linkedIssuesOf("type = test") plus a statement to get Features etc which have a Bug created, but not directly, through Test type.

The purpose is to get Features or Product Misses for which we have reported bugs.

Hope is more clear now.

Thank you.


author: Trudy Claspill
body: So, you need to find the Tests that have linked bugs.

issuetype=Test and issueFunction in linkedIssuesOf('type=Bug')

Then you want to find the Feature and Product Miss issue types linked to those Tests.

issuetype in (Feature, "Product Miss") AND issueFunction in linkedIssuesOf("issuetype=Test and issueFunction in linkedIssuesOf('type=Bug')")

ScriptRunner Enhanced Search kept giving me an error when I tried to nest the linkedIssuesOf function in that manner. So I tried saving the first filter as **Tests linked to Bugs**. Then in the second filter I used:

issuetype in (Feature, "Product Miss") AND issueFunction in linkedIssuesOf("filter='**Tests linked to Bugs'**")


author: GiorgosTsav
body: Got the result was looking for.


Tags: jira-unknown-hosting-type

unknown-hosting-type