Forums

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

JQL complicated query filter

Sharona Keren November 29, 2020

Hi, 

I'm looking for a way to search issues in 2 projects, without having duplicate Jira issues. Project 1 has all Jira issues, Project 2 has a part of Project1's Jira issues, and they are linked. 

I'd like the search to show all of Project2's Jira issues and only the issues of project 1 that doesn't have a linked issue that belongs to project2.

Is that possible? 

(I also need to filter by a certain group of assignees but I can handle that)

1 answer

0 votes
Velizar Borisov
Community Champion
November 29, 2020

Hi Sharona!

If you are "ScriptRunner Enhanced Search" user it would be pretty easy to create such a complicated query. Just use the "linkedIssuesOf" function.

In case you are not, you will have to check for something common between issues in Project 1, that you don't need to show up and exclude them. If there's nothing you can simply add a label to those you would like to be added in the filter.

Something like " project= "Project 2" or "Project = "Project 1" and label = "Marker_for_project2""  ".

Hope that helps,
Velizar

Sharona Keren November 30, 2020

The thing is, that label would need to be manually added each time, and I'm looking for an automation... 

If I was a ScriptRunner (if I'm not one I intend to become one), how could I create such a query? 

Velizar Borisov
Community Champion
November 30, 2020

Actually, you can automate the labels input too.
Just use the "Issue linked" trigger for a start and "Related issues condition" for additional condition to check if the ticket is in Project 2. Then for an action select "Edit issue" and add the label you need. 

If you decide to use ScriptRunner's Enhanced Search addon you can easily create a new filter by using this query:

Project = "Project 2" or (Project = "Project 1" and issueFunction in linkedIssuesOf("Project 2", "") )


Best regards,
Velizar

Sharona Keren December 1, 2020

Thank you! but will it work for specific link- for the certain project?

Sharona Keren December 3, 2020

Do you happen to know how can I become a ScriptRunner?

Velizar Borisov
Community Champion
December 3, 2020

Sorry to confuse you!

ScriptRunner is an additional app and installing it will give you the functionality for enhanced searching.
However, it seems like Adaptavist (the company that is behind ScriptRunner) is developing a separated app for Enhanced searching and you don't need to buy the ScriptRunner to have it.  
Here's a quick link to the app I meant.

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