Forums

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

JQL query with multi status

Anthony Pignatiello January 22, 2023

Hi

I am trying to create a JQL query and it not working. 

project = CAMSMT
Field = "Intake Request Type" in "Solus eDM request" and "Email booking request"

But I want all status of the "Solus eDM Request" and only the DONE status of "Email booking request"

It might seem really easy but I can't get this query to work. 

 

The below is saying its not valid. 

project = CAMSMT and "Intake Request Type" in "Solus eDM request", ("Email booking request" with status = done)

 

3 answers

1 accepted

0 votes
Answer accepted
Fernando Eugênio da Silva
Community Champion
January 22, 2023

@Anthony Pignatiello 

Try to use the operator 'OR' to separate your value results. Something like this:

project = CAMSMT AND "Intake Request Type" = "Email booking request" AND status = Done OR project = CAMSMT AND "Intake Request Type" = "Solus eDM request"

 

You can guilde yourself using this doc: https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/

Anthony Pignatiello January 22, 2023

 @Fernando Eugênio da Silva You are awesome! Thank you. I'll take a look at the guide also!

Nic Brough -Adaptavist-
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.
January 22, 2023

Be very careful with that query, it's not going to do what you think.

0 votes
Rilwan Ahmed
Community Champion
January 22, 2023

Hi @Anthony Pignatiello ,

Please try this JQL

(project = CAMSMT AND ("Intake Request Type" = "Email booking request" AND status = Done)) OR (project = CAMSMT AND "Intake Request Type" = "Solus eDM request")

0 votes
Nic Brough -Adaptavist-
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.
January 22, 2023

Welcome to the Atlassian Community!

You're really close, but, whilst JQL is absolutely not SQL, it has the same grammar.  It is one or many true/false questions joined together with either And or Or.

Your project = CAMSMT and "Intake Request Type" in "Solus eDM request", ("Email booking request" with status = done) works fine most of the way but breaks down because the clauses within the parentheses are not JQL and are not joined to the main query.

I find it useful to revert to a human language and then rebuild:

Show me issues in the CAMSMT project, where the field "Intake request type" has a value of "Solus eDM request", or it is an "email booking request" that is done.

Note the second , in that sentence.  I've used the Oxford comma there to make it very clear where the lists of clauses or objects are.  (I don't know where you might stand on Oxford commas, but the reality is that computers need them to understand what humans are saying to them to them.  They can't intuit it like we can)

Taking the first step to translating it into JQL, we need to break up the clauses, grouped by the punctuation, and the boolean logic.  The parenthesis indicates groups. 

Show me issues in project CAMSMT (where the field "intake" is "Solus" OR (the the field intake is "email" AND the issue is done) )

And the next step is JQL:

project = CAMSMT and ( ( "Intake Request Type" = "Solus eDM request") or ("Intake Request Type" = "Email booking request" and status = done) )

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events