Forums

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

Searching for multiple labels using CQL

Blake Pitts September 3, 2018

I'm trying to run a query to search for text within multiple labels, but if the text does not exist in one of the labels I want nothing to return. 

Using:  label IN (label1, label2) AND text ~ help, is not what I need as that works as an OR clause. 

I need it to be a 'AND' clause but can't seem to figure out how to do that. I tried:

label= exampleLabel1 AND label=exampleLabel2 AND text ~ help, but this does not appear to work. 

Is there way to do this?

Thanks!

1 answer

1 vote
Santwana Sarangi {Appfire}
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

Hi Blake,

Can you please check with this query "rest/api/content/search?cql=label in (a) AND label in (b) AND text ~ help" and see if this works?

Ref: https://community.atlassian.com/t5/Jira-questions/Searching-for-multiple-labels/qaq-p/439015

 

Thanks,

Santwana

Blake Pitts September 11, 2018

That seems to work! Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events