Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JQL Query pull subtasks w/ two specifics projects (epic in one)

Lukas August 15, 2024

Hello I have to different projects that I'm trying to view together in a board. 

I was given this however AV has over 20k issues :D and all I need is AV-12345 (epic and all subtasks) and then all items under project MAF....how could I edit jql query below for that or should i have something else? Thanks a lot for your help. JQL without the lines is much harder for me to understand than SQL. 

 

 

(project = AV AND issuetype = Epic OR issueFunction in issuesInEpics("project = AV AND issuetype = Epic") OR issueFunction in linkedIssuesOfAll("project = AV AND issuetype = Epic")) AND resolution not in (Canceled, Cancelled, "Won't Do", "Won't Fix", Duplicate)

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 15, 2024

Hello @Lukas 

Welcome to the Atlassian community.

To get the specific issue AV-12345 start with:

issue = AV-12345

To add to that all the child issues and their subtasks under that Epic:

issue = AV-12345 or issueFunction in childrenOf("issue = AV-12345")

To then also include all items from project WAF:

issue = AV-12345 or issueFunction in childrenOf("issue = AV-12345") or project=WAF

 

The sample JQL you shared is really quite different from what you specified as your requirement. It is pulling in issues that are linked to other issues. It is also constraining the results to only issues that have a value in the resolution field. I assume it is not giving you anything close to what you stated as your requirement. In such a case it is better to start from scratch and work through each piece of your requirement one at a time.

You can find information on JQL capabilities here:

https://support.atlassian.com/jira-software-cloud/docs/use-advanced-search-with-jira-query-language-jql/

 

You also showed "issueFunction" in your sample JQL. That is not a native feature of Jira and indicates you likely have ScriptRunner available in your instance. You can find information about using ScriptRunner in JQL here:

https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-enhanced-search/scriptrunner-enhanced-search-jql-queries

 

Lukas August 15, 2024

Thank you for the answer...
I think to complicate matters most seem to be linked not child of or linked with etc. The jql is pulling everything within project AV that i want i just wanted to add MAF to it to be more speicfic....sql has lines this really doesn't so i don't know where I can add to the segment to add your "or project = waf". Any ideas? Thanks so much 

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 15, 2024

I don't think I yet understand your requirement.

Are you saying the original query gives you want you want, but you want to reduce it to only giving your linked issues that are in MAF?

 

I like to use indentation to help me understand what complex statements are doing.

(
project = AV AND issuetype = Epic OR
issueFunction in issuesInEpics("project = AV AND issuetype = Epic") OR
issueFunction in linkedIssuesOfAll("project = AV AND issuetype = Epic")
)
AND
resolution not in (Canceled, Cancelled, "Won't Do", "Won't Fix", Duplicate)

 

Your query is current selecting only issues that are Resolved and have a Resolution value that is not in the list (Canceled, Cancelled, etc.)

It further limits the results so that they have to be in one of three groups.

1. The issue is in project AV and it is an Epic, or

2. The issue is a child of an Epic in project AV, or

3. The issue is linked in any way to an Epic in project AV

 

Please try to explain how you want to output to change when MAF is added to the mix.

Lukas August 15, 2024

Sorry i think the resolution not in "canceled, cancelled, "won't do, etc is fine

I just want to pull all items under MAF, and AV with all links( child, linked, subtask, etc) to show under these projects: 
Except: 
MAF I want to pull all data 

for AV I want to pull all data under epic = AV34356 

thanks, 
lukas 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 15, 2024

Thanks for that clarification.

Then the simplest thing to do is tack that on at the beginning and put your original query in parentheses:

project=MAF OR ( original query )

 

project=MAF OR ( (project = AV AND issuetype = Epic OR issueFunction in issuesInEpics("project = AV AND issuetype = Epic") OR issueFunction in linkedIssuesOfAll("project = AV AND issuetype = Epic")) AND resolution not in (Canceled, Cancelled, "Won't Do", "Won't Fix", Duplicate) )

Like • 2 people like this
Lukas August 22, 2024

Thank you so much this makes it clear :) I'll start working on this Monday. I like how you split it, it makes much better sense now :) 

Cheers, 

Lukas 

 

Like • Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Events