Forums

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

Scriptrunner: issuefunction within another issuefunction's subquery doesn't work

John Carson
Contributor
September 23, 2020

The following query:
issueFunction in issuesInEpics("issueFunction in linkedIssuesOf(\"issue in (CO-4)\",'Parent Collection Of')")

Returns the error: Error in the JQL Query: Expecting either 'OR' or 'AND' but got '"'. (line 1, character 18)

I have access to a server version of Jira with Scriptrunner and this same format does resolve correctly to give results.

 

If I remove the \ characters, giving me:

issueFunction in issuesInEpics("issueFunction in linkedIssuesOf("issue in (CO-4)",'Parent Collection Of')")

The error changes to: Failed to get issues in epic

1 answer

1 accepted

0 votes
Answer accepted
John Carson
Contributor
September 23, 2020

So I think I solved this specific one by changing to this:
issueFunction in issuesInEpics(issue in linkedIssues (CO-4, "Parent Collection Of"))

Basically I am not needing to use a scriptrunner function within a subquery of a scriptrunner function. With that said, I would like to understand if that would in fact be supported.

Kristian Walker _Adaptavist_
Community Champion
September 23, 2020

Hi John, 

I can confirm that ScriptRunner for Jira Cloud does not support nesting an enhanced search function that it provides inside of the subquery of another enhanced search function which means you will be unable to achieve doing this inside of Jira Cloud.

Regards,

Kristian

John Carson
Contributor
September 23, 2020

Unfortunate but thank you for the reply.

Kristian Walker _Adaptavist_
Community Champion
September 23, 2020

Hi John,

I have checked and can confirm that although you cannot directly nest queries that as a workaround you can first to create a query to return the results from the enhanced search function which you want to nest and can save this as a filter with a unique name.

You can then create a second query which calls this saved filter inside of the subquery of enhanced search function that you want to nest it in, in order to return all the issues for the filer you saved previously.

For your reference, I can confirm that the JQL that you would use in the subquery to return the results of the filter is filter = <NameOfFilterHere>.

An example of this would be similar to below where I have given the example syntax to show how to return issues from another filter inside the issueInEpics function.

issueFunction in issuesInEpics("filter =<FilterNameHere>")

I hope this information helps.

Regards,

Kristian

Like # people like this
John Carson
Contributor
September 23, 2020

Thank you!

Gero Kassen April 26, 2022

@Kristian Walker _Adaptavist_ 

Is it still valid, that:

I can confirm that ScriptRunner for Jira Cloud does not support nesting an enhanced search function that it provides inside of the subquery of another enhanced search function

I was able to achieve it. Maybe you can test it and change the accepted answer accordingly :)

Cheers

Andre Brongniart
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!
June 21, 2022

I cannot seem to nest anything for conditionals in Jira Cloud JQL enhanced.

example that is invalid: "... AND (this query OR that query)"

Only this works but pretty sure that is not nested queries:  "... AND this query OR that query"

Real example that is valid:

PROJECT = "SEC" AND labels != "high" AND status != "DONE" AND issueFunction in issueFieldMatch("PROJECT = "SEC"", "description", "cvssScore: 7.\*") OR issueFunction in issueFieldMatch("PROJECT = "SEC"", "description", "cvssScore: 8\.*")

Attempted nested example that is invalid - note the open and close parentheses to nest the JQL enhanced queries:

PROJECT = "SEC" AND labels != "high" AND status != "DONE" AND (issueFunction in issueFieldMatch("PROJECT = "SEC"", "description", "cvssScore: 7.\*") OR issueFunction in issueFieldMatch("PROJECT = "SEC"", "description", "cvssScore: 8\.*"))

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events