Forums

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

Jira Query Language (JQL): Advance search "WHERE" statement in JQL?

starryeyes
Contributor
February 16, 2020

My team is trying to resolve an issue to help find cross functional dependencies where the team is dependent on a task that is involved in another project. The issue here is dependencies track in different projects are not visible in the corresponding team's scrum board. 

To the resolve the problem, the team's are required to linked the impacted issues to the related stories or epics. A dashboard will pull that information to display intra and inter project dependencies base on the query to pull related links where the related link is not equal to the Project

 

Proposed Query:

(project in ("PROJECT A", PROJECT B, PROJECT C ) AND issuetype in (Story, bug, Sub-task) AND (issueFunction in hasLinks("blocks") OR issueFunction in hasLinks("is depended on by")) and status != Closed) WHERE issuefunction in hasLinks != (project in ("PROJECT A", PROJECT B, PROJECT C ) 

 

To my knowledge, JQL does not have a WHERE clause. What would be the best approach to resolve this problem?

 

2 answers

0 votes
Payne
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.
February 18, 2020

The entire JQL clause is the where clause. Simply add another AND to your proposed query, instead of a WHERE. Think of WHERE as being at the beginning of it all.

starryeyes
Contributor
February 18, 2020

I am trying build a query to that will pull intra related dependencies across different the projects. Ideally, the search return from project A where at least one of the issue keys in the related links does not share the same project key prefix as Project A. 

Proposed Query:

(project in ("PROJECT A") AND issuetype in (Story, bug, Sub-task) AND (issueFunction in hasLinks("blocks") OR issueFunction in hasLinks("is depended on by")) and status != Closed) WHERE issuefunction in hasLinks != (project in ("PROJECT A", PROJECT B, PROJECT C ) 

 

Base on your explanation, the query to follow 

(project in ("PROJECT A") AND issuetype in (Story, bug, Sub-task) AND (issueFunction in hasLinks("blocks") OR issueFunction in hasLinks("is depended on by")) and status != Closed) AND issuekey in hasLinks != (project in ("PROJECT A", PROJECT B, PROJECT C ) 

0 votes
sukkeong
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.
February 17, 2020

You can try creating a filter for the main query and call it in the current query, 

filter = "my-other-filter" AND <more filtering>

It functions by taking the result of the saved filter and apply further filtering on that result.

Hope this helps...

starryeyes
Contributor
February 17, 2020

Is there a statement where I can filter the related links based on the project key prefix?

In this case, I would want to bring related links in project A, but only return related links that do not share project A prefix. 

sukkeong
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.
February 25, 2020

I don't think you can search on key prefixes.

Suggest an answer

Log in or Sign up to answer