Prevent creating sub-tasks if parent issue is closed/resolved

Rajiv Ranjan February 25, 2020

How can I Prevent creating sub-tasks if the parent issue is closed/resolved?

I am aware that we can hide the sub-task from below two ways but I am looking for a script runner script to achieve this.

-  Hide the Create-Subtask UI element using one of the built-in Script Fragments. OR
-  We can add workflow transition, property jira.permission.edit=false

 

2 answers

0 votes
Rajiv Ranjan March 19, 2020

Since we don't want to hide the sub-task create button or disable edit issue, we have added a script validator to stop creating sub-task.

Validator on subtask create workflow.

issue.getParentObject().getStatus().name != "Done"

!("Done"==(issue.getParentObject().getStatus()))
(issue.getParentObject().getStatus().getName()=='Done')

 

Brian Longstreet March 30, 2021

Thanks for posting this Rajiv. 

Are you using a plug-in like Script Runner for this validator? Or can it be achieved without a plug-in?

Rajiv Ranjan March 30, 2021

Hi @Brian Longstreet 

Yes, using Script Runner validator

0 votes
Sreenivasaraju P
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.
February 26, 2020

Suggest an answer

Log in or Sign up to answer