Mastering Jira Query Language (JQL) Wildcards: A How-To Guide

Jira Query Language (JQL) is a powerful tool that allows you to search for issues within Jira. By leveraging JQL, you can create complex queries to extract the exact information you need from your Jira projects. One of the most useful features of JQL is the ability to use wildcards, which can help make your searches more flexible and powerful. In this guide, we'll explore how to use wildcards in JQL effectively.

Understanding Wildcards in JQL

Wildcards in JQL are special characters that represent one or more characters in a string, allowing for more flexible and broad search criteria. Jira supports two main wildcards in JQL:

  1. The Asterisk (*) Wildcard
  2. The Question Mark (?) Wildcard

The Asterisk (*) Wildcard

The asterisk (*) wildcard represents zero or more characters. It's particularly useful when you want to search for issues that contain a particular string anywhere within a field.

Example Usage:

Basic Usage

Suppose you want to find all issues where the summary contains the word "error". You can use the following JQL

summary ~ "*error*"

This query will return all issues with summaries that include the word "error", such as "Server error", "Network error detected", or "Unexpected error".

Advanced Usage

You can combine the asterisk wildcard with other strings to refine your search. For example, to find issues with summaries that start with "Deploy" and end with "success", use:

summary ~ "Deploy*success"

The Question Mark (?) Wildcard: The question mark (?) wildcard represents exactly one character. It's useful when you need to find issues where a field matches a specific pattern with a single character variation.

Example Usage:

Basic Usage

To find issues where the summary contains "bug" but with any single character before it (e.g., "debug", "nbug", etc.), use:

summary ~ "?bug"

This will return issues with summaries like "debug", "nbug", etc.

Advanced Usage

You can use multiple question marks to match a specific pattern. For instance, to find issues where the summary contains a specific three-character prefix followed by "fix", use

summary ~ "???fix"

This will return issues with summaries like "Bugfix", "Hotfix", "Newfix", etc.

Combining Wildcards with Other JQL Functions

Wildcards can be combined with other JQL functions to create even more powerful queries. Here are a few examples:

Using Wildcards with AND/OR

To find issues that contain "error" in the summary and are assigned to a specific user, use

summary ~ "*error*" AND assignee = john.doe

This query will return issues with summaries containing "error" that are assigned to John Doe.

Using Wildcards with Specific Fields

To find issues where the description contains the word "failure" and the status is "In Progress", use

description ~ "*failure*" AND status = "In Progress"

This query will return issues with descriptions containing "failure" and a status of "In Progress".

Combining Wildcards with Date Ranges

To find issues created in the last month where the summary contains "update", use

summary ~ "*update*" AND created >= startOfMonth(-1)

This query will return issues with summaries containing "update" that were created in the last month.

Best Practices for Using Wildcards in JQL

  1. Be Specific: While wildcards are powerful, overusing them can result in very broad queries that return too many results. Try to be as specific as possible to narrow down your search.
  2. Use Quotation Marks: Always use quotation marks around your search strings when using wildcards. This ensures that JQL interprets the wildcard correctly.
  3. Test Your Queries: Before using a wildcard query in a critical report or dashboard, test it to ensure it returns the expected results.
  4. Optimize for Performance: Wildcard searches can be resource-intensive, especially on large datasets. Use them judiciously to avoid performance issues.

Conclusion

Mastering wildcards in Jira Query Language (JQL) can significantly enhance your ability to find and manage issues within Jira. Whether you're looking for issues with specific keywords, patterns, or a combination of both, wildcards provide the flexibility needed to refine your searches and get precise results. By following the examples and best practices outlined in this guide, you'll be well on your way to becoming a JQL expert.

Happy querying!

Instantly Generate JQL

Enter a description to generate JQL queries with our app

Try it now