Forums

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

Making a JQL filter, with issues and epics

Jon
Contributor
September 10, 2018

Can anyone help me set up a JQL filter correctly. What I'm trying to do is include all issues of a certain type but exclude issues that have linked to an epic of a certain type. 

 

Specifically, the epic are either open or closed. the issues have names of open, assigned, loaded, sailed, or paid. I want my filter to include all issues (open, assigned, loaded, sailed and paid) but exclude the issue if its linked to an epic that is closed. 

 

thanks 

 

jon 

3 answers

0 votes
Mohamed Benziane
Community Champion
September 10, 2018

Or you can copy the value you want from epic to linked issue and show it on your issueview using the correct columns

Jon
Contributor
September 10, 2018

sorry not sure if I understand this but the filter is something that is changing all the time so we wouldn't be able to put a hard number in there. 

Mohamed Benziane
Community Champion
September 10, 2018

The value copy can be done automaticaly with scriptrunner

0 votes
Mohamed Benziane
Community Champion
September 10, 2018

Hello Jon,

 

I think you will have to use a plugin like scriptrunner that allow you to have more keyword to make you jql query like

hasSubtask(), 
issueFunction

And many more

You can look and find more informations here:

https://community.atlassian.com/t5/Jira-questions/Filter-Subtasks-Where-Parent-Task-Is-a-Certain-Issue-Type/qaq-p/525337

 

https://community.atlassian.com/t5/Jira-questions/How-to-find-stories-in-a-set-of-epics/qaq-p/455734

 

Hope this helps

Regards

Jon
Contributor
September 10, 2018

this doesn't have a subtask. I have it configured as issues and epics. Each issue is linked to an epic. an Epic has different statuses.  when I added script runner I see I can make a JQL but I notice it doesn't let me add the column epic link to the screen. Nor does it allow me to add in epic status of the epic the particular issues is linked to. 

do you have any guideance? 

Mohamed Benziane
Community Champion
September 10, 2018

Do you mean this column ?

Capture.PNG

Jon
Contributor
September 10, 2018

yeah, I have cloud verison. does that matter? 

Capture.PNG

Jon
Contributor
September 10, 2018

and then I would like it to show the epic name, as you can see the column comes up blank. probably cause the issue is not an epic per se but the epic its linked to does have these fields which is what I would want to show. 

Mohamed Benziane
Community Champion
September 10, 2018

I'm not an expert but i don't think it matter. When you click on choose columns yon don't have the epic link option ?

Jon
Contributor
September 10, 2018

that's correct. 

Mohamed Benziane
Community Champion
September 10, 2018

You will only be able to see value of fields or customfield that's exists in your screen issues and not the epic.

Jon
Contributor
September 10, 2018

so then script runner will not help me in achieving what I'm trying to do or it would take programming beyond what a novice could handle? 

Mohamed Benziane
Community Champion
September 10, 2018

If you want to retrieve data from the epic and the linked issues i guess you will need some work with API and python or other language.

0 votes
Pete Singleton
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.
September 10, 2018

To do this, you need the ScriptRunner plugin.  This allows you more powerful queries using the "issueFunction".  We have a query which does pretty similar to what you want, which is:

issueFunction in issuesInEpics("project = RIM and resolution = unresolved")

More info here:

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html

Jon
Contributor
September 10, 2018

I have script runner installed now. what do I have to do so that it works when setting up the JQL filters? 

Mohamed Benziane
Community Champion
September 10, 2018

Nothing, when you go to  search for issue enter the keyword you want like issuefunction and you will be able to see it in the suggestion:

Capture.PNG

Jon
Contributor
September 10, 2018

this is a current JQL I have is below, which allows me to search by Epic Link but not that epic links status. 

issuetype = Booking AND status in (Assigned, Loaded, "Not Loaded", Open, Paid, Sailed) AND "Epic Link" in (ES-9, ES-10)

 

but I would like to modify it to something along the lines of :

issuetype = Booking AND status in (Assigned, Loaded, "Not Loaded", Open, Paid, Sailed) AND "Epic Link" STATUS = OPEN

 

Do you have any ideas how to word that? 

Mohamed Benziane
Community Champion
September 10, 2018

Try this:

issuetype = Booking AND status in (Assigned, Loaded, "Not Loaded", Open, Paid, Sailed) AND

issueFunction in issuesInEpics(status=open)
Jon
Contributor
September 10, 2018

does this jql look proper? 

 

issuesInEpics(status=open)

 

It doesn't work but in theory if it did I would be able to work out the other pieces. 

Mohamed Benziane
Community Champion
September 10, 2018

Try to use double quote like this

IssueInEpics("status = open")

Instead of status=open who can use an another filter if you want.

Jon
Contributor
September 10, 2018

still doesn't work. Capture.PNG

Mohamed Benziane
Community Champion
September 10, 2018

Try:

IssueFunction IssueInEpics("status = open")

Suggest an answer

Log in or Sign up to answer