Hi all: I'm trying to do something similar to Open Parent Issues with All Subtasks Closed but in JIRA Cloud, using ScriptRunner Enhanced Search.
Here's the accepted answer for ScriptRunner running on JIRA Server:
project = PROJECT and issuefunction in parentsOf("issuefunction in subtasksOf(\"issuefunction not in parentsOf('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes()\") and status = closed")Unfortunately, SRES doesn't seem to like this:
Error in the JQL Query: Expecting ')' or ',' but got 'not'. (line 1, character 45)
I thought it might be the backslashes to escape the ", as it seems SRES is less picky about that. But when I remove the backslashes, I get:
Field 'issuefunction' does not exist or you do not have permission to view it.
My actual query is slightly trickier, requiring even more quotes, but I've tried all kinds of variations on single-quoting, double-quoting, alternating between the two, and I still have no luck:
project = PROJECT AND issuefunction in parentsOf("issuefunction in subtasksOf("issuefunction NOT in parentsOf("type='production release subtask' AND status != approved") AND type="production release" AND status != approved ") AND status = approved ")Does SRES support this kind of deep nesting? This non-nested query below almost gives me what I want, but for some reason still returns a parent issue that has subtasks that are Approved and Done. I would like to only get parents where subtasks are all in Approved status.
project = PROJECT
AND type = "production release"
AND status NOT in ("done", "completed", "canceled")
AND NOT issueFunction in parentsOf("type='production release subtask' AND status!=approved")
AND issueFunction in parentsOf("type='production release subtask' AND status=approved")
I appreciate any insights. Thank you!