We have a story and the story has 'n' number of sub-tasks and each subtask may/may not linked issues (issue type = bug) is blocked by.
I need to frame the JQL query with below condition
1. List out all the subtask which have linked issues?.
2. Get the linked issues count of each sub-task wise?
The first query requires the help of a third party app like ScriptRunner for Jira Cloud, thanks to the hasLinks() function:
issueFunction in hasLinks("is blocked by") AND type = Sub-task
The count of linked issues for each subtask is even trickier to obtain on Cloud. Maybe you can export to csv using the semicolon character (;) as a separator and open the resulting file with a spreadsheet tool (ie: Excel) and use one of its functions to obtain the desired numbers.
Alternatively, your two purposes could be covered by Structure Cloud app. I've just used the Server version, but even if it counted with half its features, it would be definitely worth it.
Hope it helps.
I can confirm that the query provided above is for ScriptRunner for Jira Server and will not work with ScriptRunner for Jira Cloud due to the differences in the plugin which you can see in the documentation page located here.
I can confirm that in ScriptRunner for Jira Cloud that hasLinks is a JQL keyword as described here and on this page you will see examples of how to use this keyword to search for issues which have links.
I hope this information helps.
There is a number of JIRA plug-ins, which provide a JQL function for your case:
We are the vendor of the latest one, so feel free to ask any question regarding it.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events