Forums

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

substring search within title field?

edburns December 3, 2022

Hello,

Consider that I have user stories with names like the following

  • 2022-Q2-pictures
  • 2021 Q1-pictures
  • 2022 Q3 pictures

That is, the text sometimes has hyphens between words, sometimes spaces, sometimes both.

I want to write a query that finds all of them.  If I search 

issuetype = Story AND text ~ "pictures"

I do not see the ones where a hyphen connects "pictures" to preceding text.

 

How can I write a query that finds all of them?

 

2 answers

1 vote
Darryl Lee
Community Champion
December 3, 2022

Hey @edburns and @Alex Koxaras _Relational_ :

Aren't story names in the Summary? When I did some testing with just "2*pictures" it matched this test issue "Need New Part - Part number 2". 

Hrm, weird that the * picks that up, despite the "pictures".

If you can are able to constrain your search to this decade (2020-2029), that might help at least narrow it down bit. (See below.)

Also, I think you'd need a .* in there somewhere.

issuetype=Story and summary ~ "202?.*pictures"

But yeah this still matches this Summary:

Do this thing by 2022-02-22

So it also seems that you can't constrain "fuzzy" searches (that use the ~ character) to the beginning of the string.

I'm sure this has been covered somewhere beyond the official docs... let's see.

Ah yeah, here's the relevant bug:

You can use regular expressions in the issueFieldMatch JQL function in its ScriptRunner Enhanced Search but that would require purchasing that add-on. Also, ScriptRunner search is a little different, since you can't use those functions directly in Jira searches.

1 vote
Alex Koxaras _Relational_
Community Champion
December 3, 2022

Hi @edburns 

If your text has a year in front of the work picture, then you can use the:

text ~ "2*pictures"

But you can't place the "*" in front of "pictures".

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events