Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Syntax for nested issuefunction

Hey All,

@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..

  • 4th level (outer): '
  • 3rd level: \'
  • 2nd level: "
  • 1st level (inner): \\\'


1 answer

1 accepted

1 vote
Answer accepted

Hello Bizz,


Nested 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:


  • 4th Level (Outermost): Single quotes '
  • 3rd Level: Escaped single quote \'
  • 2nd Level: Double quotes "
  • 1st Level (Innermost): Triple escaped single quote \\\'

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.


Example Scenario


Suppose you have a nested issueFunction query where, at the second level, you need to search for a phrase like "Free Text".


  • Outer Query: '
  • Inner Query: \"Free Text\"

Constructing the Query


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\")')

Tips for Complex Queries


  1. 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.

  2. Testing Incrementally: Test each level of nesting separately to ensure that it returns the expected results before combining them.

  3. Escaping Characters: Pay special attention to escaping characters. In JQL, the backslash (\) is used to escape quotes.

  4. Consult Jira Documentation: For complex queries, refer to the Jira documentation or Atlassian Community for examples and guidelines.

  5. 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.

  6. Avoid Overcomplication: If a query becomes too complex, consider if it can be simplified or broken down into multiple simpler queries.

Additional Resources


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.

Awesome, thank you @Pablo Brincat for the detailed answer. Yes, I usually break inner ones into its own filter but was curious if I had to do it, how to properly escape and this info by you helps a lot with planning for future!

Suggest an answer

Log in or Sign up to answer