Forums

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

Need JQL query help using both "includes" and "excludes" in the same query

Doug Henderson March 7, 2018

I am trying to create a query to find Jira issues in a project that include the Comment text "Ready for UAT" but exclude the Comment text "UAT done". 

In other words, if Comments in an issue only include the phrase "Ready for UAT" then display that issue in the results.  However if the Comments in an issue include both "Ready for UAT" and "UAT done", then exclude that issue from the results. 

I've tried various combos of ~ and !~, AND and NOT, etc. but nothing succeeds so far.

For example, 

project = ABCD AND Comment ~"Ready for UAT" AND Comment !~ "UAT Done"  

does not succeed. It still shows results that include both phrases.

Any suggestions?

1 answer

0 votes
Boris Berenberg - Atlas Authority
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.
March 7, 2018

The problem is that you have UAT in both. I would try something like

project = ABCD AND Comment ~"Ready for" AND Comment !~ "Done"  
Doug Henderson March 7, 2018

I just tried the recommended solution but got the same unsuccessful result. It is still including issues with both strings in the Comments.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events