9

There is no regexp in JQL: https://answers.atlassian.com/questions/138055/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

What is the meaning of * in a jql Query?, I have different results when using and not using it. But I didn't find any consequence in the results.

nagy.zsolt.hun
  • 6,292
  • 12
  • 56
  • 95

2 Answers2

25

~ means CONTAINS, so

summary ~ win

means WHERE summary CONTAINS the exact word win. * is a wildcard. The example:

summary ~ "win*"

means WHERE summary CONTAINS win and any multiple character combination after it.

There are two types of wild-cards in JQL: ? and * where:

  1. To perform a single character wildcard search use the "?" symbol.
  2. To perform a multiple character wildcard search use the "*" symbol.

Check the JIRA advanced searching guide and the wild-card explanation here.

Borislav Sabev
  • 4,776
  • 1
  • 24
  • 30
  • 2
    works not for every field. For example, `fixVersion ~ 1.4.*` returns error `The operator '~' is not supported by the 'fixVersion' field.`, at least in Jira 6.0.4 – Andrey Regentov Jan 29 '15 at 10:03
  • 5
    For version fields like `fixVersion` and `affectedVersion` you have to use the `versionMatch()` function, e.g. `fixVersion in versionMatch("15.2.*")`. – Frederik Jun 11 '15 at 02:01
  • 2
    Doesn't work for sprint~"Yamaha*" . Returns error "The operator '~' is not supported by the 'sprint' field." – eureka19 Apr 25 '17 at 18:29
0

Atlassian calls the '~' operator "contains", but it doesn't actually mean "contains". For example, searching the Customer field (a custom text field) for "ABCD" will return a hit for "ABCD, EFGH" but not for "EFGH, ABCD". And you can't use the wildcard character * at the start of the search string. See wildcard searches and JRASERVER-6218 for more. We're investigating Adaptavist ScriptRunner to work around this 12 year-old bug.

Stretch55
  • 101