Query JIRA versions using wildcards with JQL

Gary Seven picture Gary Seven · May 22, 2014 · Viewed 11.6k times · Source

Is there a way to search a field with wildcards?

I have two fields and I just want names starting with DEVX. I have tried quotes and asterisks, like "DEVX*". Is there a way to do it in this query? These are custom fields of type Version Picker with JIRA 5.2.4.

eg.

project = XXXXXX and "Target Release" = "DEVX" or "Fixed In Version/s" = "DEVX"

Answer

Scott Dudley picture Scott Dudley · May 22, 2014

With the Script Runner for JIRA add-on, you can use JQL such as this this:

project=MYPROJ and fixversion in versionMatch("DEVX*")

You can use other types of regular expressions with the versionMatch operator, like "1.*" and so on.

If you are using JIRA OnDemand and you do not have the ability to install add-ons, Script Runner will not be available to you. However, one other thing that may help is that versions in JIRA are ordered (or at least they can be, if you drag them into an appropriate order from the administration screen for project versions). Once you've done that, you can perform comparisons with versions based on the order you assigned, like this:

project=MYPROJ and fixversion >= "1.2" and fixversion <= "1.5"

If you have your DEVX versions grouped together, then this technique could work for you too.