Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Proper syntax for doing quadruple nested issueFunction JQL statement?

Jimmy Petersson
Contributor
March 25, 2021

Hi,

Doing project automation in Jira.

My data model looks like this:

            Initiative
|
-------|---------
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

6 votes
Answer accepted
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2021

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 ðŸ™‚

 

//Radek

Jimmy Petersson
Contributor
March 26, 2021

Thanks a million, Radek!

Like • # people like this
Oliver Steadman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2022

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

Suggest an answer

Log in or Sign up to answer