Forums

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

What is the JQL for issuetype = task or issuetype = subtask if parent = task?

Jonathan Smith
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.
June 3, 2024

Morning everyone,

Ai is failing me today, so I am going to try to challenge the community with this one.

I have a large project which has multiple issue types.

In a filter, I want to show a desired issue type along with any sub tasks where the parent is the desired issue type.

Can someone assist me with this JQL?

Cheers,

Jonathan

 

2 answers

0 votes
Mohammed Yousuf
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 3, 2024

Hi @Jonathan Smith ,

 

Here is the complete JQL query using ScriptRunner: The last part 'issuetype = subtask if parent = task' requires to use issue function which is not native in Jira hence you need to use Script runner.

 

jql issuetype = Task OR (issuetype = Sub-task AND issueFunction in subtasksOf('issue

Trudy Claspill
Community Champion
June 4, 2024

@Mohammed Yousuf 

Your JQL statement is incomplete.

Jonathan Smith
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.
June 11, 2024

@Mohammed Yousuf We are not purchasing an add-on for this situation. It would be nice if you could get that search functionality in the native application ;)

0 votes
Trudy Claspill
Community Champion
June 3, 2024

Hello @Jonathan Smith 

That will not be possible with the native JQL capabilities.

You can create a filter such as this:

issue=ABC-123 or (parent=ABC-123 and issueType=Sub-task)

That filter will get you issue ABC-123 and all its sub-tasks.

What you want is this:

issueType=<yourType> or issue in subtasksOf(issueType=<yourType>)

Jira does not natively support getting a set of issues based on a dynamic list of another set of issues (the part in bold). To achieve that you will need a third party app that extends JQL capabilities, such as ScriptRunner Enhanced Search. Are you open to getting a third party app, or do you have such an app available to you already?

Suggest an answer

Log in or Sign up to answer