Forums

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

ScriptRunner JQL Query to check if Parent is not Closed

Deleted user
June 18, 2018

We have a Sub-Task workflow that has a "Re-Open" step that would allow a user to re-open that sub-task - but we want to prevent it if the Parent task is "Closed". 

I have used the following JQL query:

"((issueFunction in parentsOf("issuetype in subTaskIssueTypes() And status not in (closed)")) OR (issuetype not in subTaskIssueTypes() and status not in (closed) AND!(issueFunction in hasSubtasks())))"

This seems to prevent the sub-task from being re-opened, even if the Parent task is not "Closed".  What am I missing?

1 answer

1 accepted

1 vote
Answer accepted
Alexey Matveev
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 Champions.
June 18, 2018

Hello,

Your JQL should be like this

issueFunction in subtasksOf("status not in (closed)")
Deleted user
June 21, 2018

Thanks Alexey!! Your uncomplicated script took care of it easily!! :)

Alexey Matveev
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 Champions.
June 21, 2018

You are welcome!:)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events