Forums

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

JQL to make card red when a task has a subtask that can't be done because its blocked

Dennis Celen January 25, 2023

is there a way to show a card of an task issue red when is has a child issue that also can't be done because its blocked by another task?

1 answer

1 vote
Ashish Bijlwan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2023

Hi @Dennis Celen 

You can achieve this using ScriptRunner Enhanced Search functionality that comes with the ScriptRunner Plugin because Jira Cloud directly doesn't allow the "issueFunction in parentsOf("")" function and for 1st part your requirement "to list out all the Tasks that has child issues in it" this function is needed. 2nd part of your requirement doesn't requires this plugin as it can be directly pulled using JQL "issueLinkType = "is blocked by"".

If you are already using the ScriptRunner Plugin in your Jira Cloud instance then you Go to ScriptRunner Enhanced Search

image.png

and Click on + icon as highlighted in below screenshot

image.png

Click on parentsOf on left panel and then type the Subquery as per your requirement and click on Add to Query button
image.png

in below example I have added the Subquery as Project = W2

image.png

After clicking on the Add to Query button, you will get screen like below:

image.png

here you need to add on more query i.e., issueLinkType = "is blocked by" that will filter your search result and only extract those issues from the project that has child issues and is blocked by another issue.

Your final query to the above screen will have JQL issueFunction in parentsOf("project = w2") and issueLinkType = "is blocked by" as shown in below screenshot.

image.png

After that click on Search button it will give you the result. And then Click on Save as filter and call the filter to your board Card Color section like below:

image.png

That's all you will have the card of an task issue in Red when it has a child issue that also can't be done because its blocked by another task

image.png

 

Thank you,
Ashish

Winnie Andersen July 17, 2023

Thanks Ashish, this was very helpful to make my understand how ScriptRunner works. 
Though I can't get the result I want. Maybe you can help me?

I made the following JQL's:

issueFunction in parentsOf("issuetype = 'sub-task' and status = closed") (GREEN)

and 

issueFunction in parentsOf("issuetype = 'sub-task' and status != closed") (RED)

The idea was to use these to show a red card color this the task or story had any open subtasks and another one is they were all closed. 
The search in ScripRunner seems to work fine, but I can't figure out why this isn't working on the cards.

I have one story with all subtasks closed (Showing red)
I have one story with open subtasks (showing green)
Task doesn't show color at all.

What am I doing wrong?


Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events