Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner JQL Query to Find Linked Issues of "is blocked by" AND Linked Issues' Status != Done

Paul March 2, 2020 edited

Hi,

What would be a JQL query to find (linked issues of type "is blocked by") AND (linked issues with status != Done) for a particular issue?

Example:

Issue ABC-1 is blocked by ABC-10 with status Done, ABC-20 with status Backlog and ABC-30 with status "In Progress".

The query should return ABC-20 and ABC-30.

 

1 answer

1 accepted

2 votes
Answer accepted
Jack Nolddor _Sweet Bananas_
Atlassian Partner
March 2, 2020 edited

Hi Paul,

Sadly you cannot achieve the desired search using standard features on Jira, you must go for a third-party app instead. Using i.e. JQL Booster Pack you can type the following:

 

Search for issues that blocks others issues OR linked issues with status != Done:

issue IN linkedIssuesOf("status != Done", "is blocked by")

Note that this is just an exaple, you must tune your query to fit your needs

Using this app you can also query other issues relations, check:

 

References:

 

Hope this helps you to create awesome queries <3

Kind regards

Paul March 3, 2020

Hi Jack,

I should've mention I have ScriptRunner.

I'd prefer to use JQL with ScriptRunner's JQL extentions instead of be forced to use SQL.

Thanks for you reply.

Jack Nolddor _Sweet Bananas_
Atlassian Partner
March 3, 2020 edited

Hi Paul,

You can use the query I provided before on Script Runner as well.

However, you must note that you must query the issueFunction field instead

 

Use this

issueFunction IN linkedIssuesOf("status != Done", "is blocked by")

 

Regards

Like • Pit Pettersen likes this
Paul March 3, 2020

I tried a lot of times, after all it seems so easy, but wasn't able to get correct results.

I could get ALL issues' blockers but couldn't get ONLY blockers for ONLY 1 specific issue.

REgards,

Paul

Jack Nolddor _Sweet Bananas_
Atlassian Partner
March 3, 2020 edited

Have you tried using this query:

 

status != Done AND issueFunction IN linkedIssuesOf("key = ABC-1", "is blocked by")

 

In your example:

Issue ABC-1 is blocked by ABC-10 with status Done, ABC-20 with status Backlog and ABC-30 with status "In Progress".

The query should return ABC-20 and ABC-30.

Paul March 3, 2020

Well, it is official now - I am an idiot :-)

That worked - thanks Jack!

Like • Jack Nolddor _Sweet Bananas_ likes this
Naziya Parveen
Contributor
October 23, 2024

Hello, What query can I run if I need to know issues having confluence content or page linked? 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events