Gary Seven
Gary Seven

Reputation: 109

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"

Upvotes: 4

Views: 14803

Answers (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.

Upvotes: 2

Scott Dudley
Scott Dudley

Reputation: 3298

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.

Upvotes: 7

Related Questions