'Query JIRA versions using wildcards with JQL

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"


Solution 1:[1]

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.

Solution 2:[2]

Another way to do this search is using the tilde character (you can select it from the dropdown when you're writing queries):

project=MYPROJ and fixversion ~ "DEVX*"

You don't need any JIRA add on to do this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Scott Dudley
Solution 2