Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,741
Community Members
 
Community Events
184
Community Groups

JQL search for string with underscoere?

How do you do a JQL search using the ~ operator for the literal string "NO_SOD"? When I try text ~ "NO_SOD" I get issues which have NO and/or SOD.

2 answers

0 votes
Davin Studer
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.
Jan 15, 2019

I have found that underscores and dashes tend to mess up searches. In fact there is a bug ticket for this JRASERVER-31882. If you have ScriptRunner you can do this ...

issueFunction in issueFieldMatch("", "summary", ".*NO_SOD.*")

Also according to JRASERVER-6218 Jira 8.0 will support regex searches natively so you should be able to do this soon-ish ...

summary ~ "/.*NO_SOD.*/"

I won't hold my breath. Atlassian's work around is to recommend using ScriptRunner. I'm not sure why Atlassian doesn't just buy that company and integrate their tools directly into Jira.

Davin Studer
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.
Jan 15, 2019

Actually, I just re-read the second issue (JRASERVER-6218) and it looks like they had to back out regex searching in Jira 8.0. :( But if you happen to have ScriptRunner you could still do it that way.

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 15, 2019

you need to do an exact match I believe. see if this document help - advanced-searching-operators-reference. I have had mixed luck w/ this TBH. if i get a minute I will give your UC a try.

I've looked at the link you posted. Issue is that text ~ "NO\_SOD" is not valid. You get the error "Error in the JQL Query: '\_' is an illegal JQL escape sequence. The valid escape sequences are \', \", \t, \n, \r, \\, '\ ' and \uXXXX. (line 1, character 11)"

This seems like a bug. I'll probably report it to Atlassian so they can ignore it for 7 years.

Like Alex Read likes this
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 15, 2019

yep, like I said mixed luck for me too. it might be that I'm using incorrectly or just limitations. I will ping other champions to see if they want to test their Jedi-JQL skill on this. It wouldn't hurt to create a support ticket. While it may not result in a 'fix' maybe a clear answer which would be good to post back here.

Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 15, 2019

Hi @Benjamin Peikes,

are you on cloud or on server?

I just tried this on server and I have one issue having only NO in the summary, one with SOD and one with NO_SOD.

If I search for summary ~ "NO_SOD" I get only the one issue with NO_SOD, also with text ~ "NO_SOD"

On Cloud, it behaves different.

I just created the same issues, and when I search for "NO_SOD", I get the issues with NO_SOD and SOD, but not the one with NO.

Kinda weird.

Just tried to search for "NO?SOD" and thought, there can be only one result, but I get a lot of different results, containing not even NO and/or SOD.

Maybe this is also related with https://jira.atlassian.com/browse/JSWCLOUD-16529

Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 15, 2019

I just tried to search for NO?SOD on server, and there I don't get any result, so also not the expected behaviour :-(

Bastian,

The issue you listed is unrelated, search works, it just treats "NO_SOD" as a search for anything with the words "NO" or "SOD". Basically, it's broken.

https://jira.atlassian.com/browse/JSWCLOUD-16529 

Like Alex Read likes this
Samarth S
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 11, 2023 • edited

I know it's late but fwiw:
You can try:

summary~"\"NO_SOD\""

This behaves exactly as expected. 

Reference: https://jira.atlassian.com/browse/JRASERVER-14641
Read the comments in the above ticket

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events