You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Join now to unlock these features and more
@Radek Dostál in the below link shared a way to use quotations 4 levels deep.. If I follow his hierarchy it works and if I change the order it does not... so seems like this is some rule...but in my case, in one of the inner clauses, I need to search for free text and that needs its own quotations.. so wondering if there is any clear documentation for this..
issueFunction queries in JQL (Jira Query Language) can indeed become complex, especially when dealing with multiple levels of quotation marks. The key to managing this complexity is understanding how Jira processes these quotation marks at different nesting levels.
The hierarchy shared by Radek Dostál in the Atlassian Community post you referenced suggests a pattern for escaping quotations at each level to ensure that the query is parsed correctly. Here’s a quick breakdown:
When you need to include a free-text search within one of these nested clauses, it can get tricky, especially if the text itself contains quotation marks. The goal is to ensure that each level of nesting correctly escapes the quotations of its inner level.
Suppose you have a nested
issueFunction query where, at the second level, you need to search for a phrase like
You would construct the query by embedding the inner query into the outer one, ensuring that you escape the quotation marks correctly at each level. Here’s a hypothetical example:
issueFunction in someFunction('...other criteria... AND issueFunction in anotherFunction(\"Free Text\")')
Start from the Innermost Part: Build your query from the inside out. Get the innermost query working first, then embed it into the next level.
Testing Incrementally: Test each level of nesting separately to ensure that it returns the expected results before combining them.
Escaping Characters: Pay special attention to escaping characters. In JQL, the backslash (
\) is used to escape quotes.
Consult Jira Documentation: For complex queries, refer to the Jira documentation or Atlassian Community for examples and guidelines.
Use a Text Editor: A text editor that highlights syntax can be helpful in visualizing the structure of your query and ensuring correct quotation usage.
Avoid Overcomplication: If a query becomes too complex, consider if it can be simplified or broken down into multiple simpler queries.
For specific syntax related to
issueFunction and ScriptRunner (if you’re using it), consult the relevant documentation or community forums. ScriptRunner’s documentation often provides examples of complex JQL functions, which can be very helpful in understanding the syntax.
Remember, the key is ensuring that each level of nesting correctly interprets its inner query, which is achieved by proper use of escape characters for quotations.