JQL Query to filter out issues where Summary contains a particular word

Keith Sellon-Wright June 3, 2016

I need to create a search filter that excludes all issues that contain the word "CLONE" in the Summary field.  (I have 5 issues used to clone to make new issues and don't want my users to accidentally update those when looking in search results.  They have Summary text with variations of "00-CLONE ME" etc.)

Right now my query is this - just need to add that last filter.  Have tried a number of variations, but with no luck. Any help is appreciated!

project = PM AND status in (Open, "In Progress", "Initiate Campaign", "Gathering Rqmts", "Testing Camp Setup", "Pending Doc", "Assgd to PM", "Assgd to Tech", "Modify DO Template", "In Prog - DO Templ Mods", "Clt Approved Script", "In Progress - PM", "Approval Requested", "Pending Client Apprvl", "Request Client Revisions", "Pending Client Revisions", "In Progress (Tech)", "Pending Data Contact Revs", "C-List Load Issues", "Extract Test Data", "Pending Data Contact Apprvl", "Test DO Approved", "Pre-Flight Complete", "Validate Pre-Flight", "Ops In Progress", "Ops Compl - Awaiting Closure", Assigned) ORDER BY created DESC

2 answers

1 accepted

8 votes
Answer accepted
Meck
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.
June 3, 2016

Keith, Do you want to create a serch filter that excludes all issues that contain the word CLONE in the Summary filed?

So you can put 

*summary !~ "CLONE"*

at the search issue.

Regards.

Lameck.

Keith Sellon-Wright June 4, 2016

That got me there, though it isn't exact so figured I should post this update.  Here's what I added to my existing query that worked:

AND summary !~ CLONE 

The * characters threw an error.  (working in Cloud version, so maybe that's why? Not sure)

Bottom line - it's working for me and will save me many headaches in the days to come.  Thank you.

Like # people like this
Meck
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.
June 4, 2016

Keith, good! 

The * is a typo. :/ 

But it's very good read that filter will save your time. laugh 

Regards.

Like # people like this
Gomez_ Daniel October 12, 2021

this worked for me, thanks!!!!!

2 votes
Eren March 19, 2018

It still doesn't work for me. 

I'm trying to return back-end stories that are labelled as [BE] in the issue summary. Can someone tell me what is wrong with this JQL? 

project = "X" summary ~ "\"[BE]\"" ORDER BY summary ASC, priority DESC, updated DESC 

It's not returning any issues even though a lot of issues has "[BE]" in the summary. 

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2018

Hi @Eren

Jira cannot properly do partial word searching.  In turn it does not actually do well at searching mixed character strings.   Instead it is built to search for complete words.  Since this tag is rather short and contains other characters of "[" and "]" that is going to make it more difficult to find those issues when trying to extract this text out of summary field.   This partial word searching limitation is also noted in our documentation on Search syntax for text fields: Limtations: Whole words only.

However there could be other ways to find this information.  For example, the scriptrunner plugin for Jira will allow you to use regex searches in JQL searching.  Check out https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_issuefieldmatch

This function provided via this plugin would then allow you to create a JQL syntax of something like this:

issueFunction in issueFieldMatch("project = X", "summary", "\[BE\]")

In turn this should then allow you to find the issues that might have that specific string in them.

It is also possible there are other plugins for Jira that can help here, I only cited the scriptrunner one because I know it has this regex search ability within JQL.

I hope this helps.

Andy

Like # people like this
Mash Huang July 30, 2018

Hi @Andy Heinzer

You save my life.  Thank you very much.

Victor Catano October 23, 2019

Hi @Andy Heinzer, the explanation makes sense to me but it doesn't explain why  the following sentence word properly:

project = "X" summary ~ "FE

But this sentence doesn't bring results:

project = "X" summary ~ "BE

¯\_(ツ)_/¯

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2019

Hi @Victor Catano 

That's very strange to see.  So I tried to replicate this behavior.  I found that I too could not find issues with the advanced JQL search of just

summary ~ "be"

Despite knowing that I have created issues with that very short word in the summary.  So in the process of investigating this, I switched the search from advanced back down to basic.  Then selected Summary and the word 'be'. I found this worked as expected, and returned the results:

Screen Shot 2019-10-23 at 9.01.35 PM.png

So then I switched modes back to advanced.  I found that my string had additional escaping characters and an additional set of quotes.  

Screen Shot 2019-10-23 at 9.01.49 PM.png

summary ~ "\"be\""

to be exact.

I'm still not sure why this is yet, but it does work.  I thought perhaps there exist certain words that are reserved in JQL, indeed there are, you can see a list of these in you can see in Advanced Searching: Restricted and reserved words.  But for whatever reason "Be" is not listed in that list.  I'm not sure is this is an oversight in the documentation, or a yet undocumented bug.  But I'm going to look into this further to try to figure that out.  Thanks for bringing it up.

Andy

buksy January 17, 2020

Hi guys, it doesnt work because "be" is reserved word for JQL, it can be used as verb.

To use it you have to escape it similarly as @Eren did (\"[BE]\") so in your case just \"BE\" should work

Like Cassie Kern likes this
Elliot Gates July 15, 2020

You forgot the and

project = "X" AND summary ~ "\"[BE]\"" ORDER BY summary ASC, priority DESC, updated DESC 

Connor Bell November 5, 2020

If anybody is encountering this now - The above posts claiming that "BE" is a reserved word is incorrect, and the above fixes will not work if your JIRA is set to English indexing.

This issue is caused by stemming. Jira will remove common English words when indexing issues. This can be resolved by:

System > General Configuration > Edit Settings > Indexing Language > Other > Update

You will now be able to search for "BE" correctly, without escapes. However, you will still need to use

"\"[BE]\""

for the brackets.

Credit to SimonThePug on Reddit.

Note that you may need to force a reindex on your project before this works fully.

Suggest an answer

Log in or Sign up to answer