what does the ~ do in a JQL?
- User
what does the ~ do in a JQL?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
what does the ~ do in a JQL?
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
In JQL (Jira Query Language), the ~ (tilde) operator is used for performing text searches or "contains" matches on text-based fields.
Here's a breakdown of what it does and how it works:
"Contains" Logic: It checks if a specified field's value contains the given string of text. It doesn't require an exact match for the entire field content.
Case-Insensitive: The search is case-insensitive. So, summary ~ "bug" will find "Bug", "bug", "BUG", etc.
Implied Wildcards: This is a crucial point:
LIKE operator where you often use % for wildcards (e.g., LIKE '%keyword%'), JQL's ~ operator automatically treats your search term as if it's surrounded by implicit wildcards.* or % yourself when using ~. The operator inherently looks for the term anywhere within the field's value.Applicable Fields: It works on fields that store significant amounts of text, such as:
summarydescriptioncommentsenvironmentExamples:
Let's say you have issues with these summaries:
"Login Error on Production Server"
"User reported login issue"
"Fixed bug in user authentication"
"Network Connectivity Problem"
summary ~ "login"
description ~ "database error"
comment ~ "attachment"
environment ~ "Windows 10"
Comparison with = (Equality Operator):
= (Equals): Used for exact matches.
summary = "Login Error" will only find issues with the summary "Login Error" (exactly that phrase, case-sensitive if not specified otherwise, but generally exact).~ (Tilde): Used for "contains" / text searches.
summary ~ "Login Error" will find "Login Error", "Login Error on Production Server", "User reported login error", etc., as long as "Login Error" (or its case-insensitive equivalent) is present anywhere in the summary.When to Use ~:
Considerations:
~ queries can be slower than exact (=) or IN queries, especially on very large Jira instances, as they require more processing to scan the text fields.