How can I use regex in a JQL query? I cannot match strings that have a specific ending in JQL (ex: *ing ; should match running, jogging, etc.)...

Eric Gross February 14, 2013

Is there a way to use regex in JQL? If not, is there a way to use a wildcard character at the begining of a string? When I use the following to match any issues that contain "Citrix", I recieve the following error:

 project="SPDM" AND status="open" AND summary~"*Citrix" AND summary~"Requests"'

 Query validation failed: The text query '*' for field 'summary' is not allowed to start with '*'.

I'm using the JQL for queries I am making with a SOAP client (I know SOAP is being replaced by REST, but I am sticking with it for now). Is it possible to use the wildcard this way? I can run the query like this to get some results; but it doesn't match results like DEVCitrix, PRODCitrix:

project="SPDM" AND status="open" AND summary~"Citrix" AND summary~"Requests"'

I would prefer to stay away from plugins if possible...

Thanks

4 answers

11 votes
rafaferreira March 2, 2017

For any heavy JIRA user, we do need this feature, I don't want to pay more for any other plugin. Atlassian need to provide this feature.

Kiran01BM March 17, 2017

Thumbs up! I do feel the same, Is anyone aware of a feature request raised for this ?

swapna.ragi June 9, 2017

I totally agree with this, why should we pay more for this

Julia T April 27, 2020

 Script Runner plugin will help
See comments below

4 votes
Mark Symons
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.
February 16, 2013

Try the Script Runner plugin. Yes. I know you would prefer to stay away from plugins - but Script Runner is currently free.

The newly-introduced (still Beta) JQL regex offers a issueFieldMatch function that looks like it might help.

3 votes
Jozef Kotlár
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.
February 15, 2013
  • no - regular expressions are not supported by JQL -see documentation
  • no - wildcard cannot be on the beginning

Both are restrictions of used searching engine - Lucene.

0 votes
Nick September 15, 2015

Yes, "Script Runner" is good. For example you can matching projects by name pattern

e.g.  project in projectMatch("Dev - *")

See previous answer

 

Also have a look at what you can do matching text fields too (https://confluence.atlassian.com/jira/performing-text-searches-185729616.html)

Mark Risman June 23, 2016

That seems helpful if you're searching in projects, but the link here for text searches does not currently explain how to search using a regular expression

Suggest an answer

Log in or Sign up to answer