Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Proper syntax for doing quadruple nested issueFunction JQL statement?


Doing project automation in Jira.

My data model looks like this:

Epic Epic
| |
---------- -----------
| | | |
Story A Story B Story C Story D

Have an automation use-case that requires traversing from Story A or B, up to Initiative, and then down to Story C or D.

This requires four nested issueFunctionOf statements. My personal record until now was a triple-nested statement. Since the nested queries are used in project automation, and it is the inner JQL statement that controls the query, I do not have the option to use nested filters. 

I searched through the documentation and found examples only of double nested statements using double- and single quotation marks. This forum helped me get three nested levels under my belt using \". 

This is my JQL statement:  

issueFunction in issuesInEpics("issueFunction in linkedIssuesOf('issueFunction in linkedIssuesOf(\"issueFunction in epicsOf(\'key= BEAM_OVP-9852\') \") ') ")

In above example I tried using the following hierarchy:

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

But that does not work.

This leaves me with two questions:

  • How many nested levels does Jira actually support?
  • What is the sequence of quotation marks to escape four levels of nested JQL strings?

1 answer

1 accepted

3 votes
Answer accepted

Hi @Jimmy Petersson ,


I tried a few, this one doesn't error out among the others:

issueFunction in issuesInEpics('issueFunction in linkedIssuesOf(\'issueFunction in linkedIssuesOf("issueFunction in epicsOf(\\\'key= BEAM_OVP-9852\\\') ") \') ')
  • 4th level (outer): '
  • 3rd level: \'
  • 2nd level: "
  • 1st level (inner): \\\'

Although pretty sure it can be improved a bit but the triple backslashes seem to do the trick ðŸ™‚



Thanks a million, Radek!

Like • Oliver Steadman likes this

This is a beast of a query. Thank you Radek, my hero.

Suggest an answer

Log in or Sign up to answer