How to block subtask creation when the parent issue is done for specific issue type

Venkata Sagar August 1, 2022

Hi ,

I want to block subtask creation when the parent issue is done status.

Thanks 

2 answers

1 accepted

0 votes
Answer accepted
Max Lim _Adaptavist_
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.
August 1, 2022

The easiest way to achieve that is to use Simple Scripted Validator on Create transition for the sub task issue type(s) with following snippet:

issue.parentObject?.status.name != "Done"

simple scripted validator configuration.png

An error message will be displayed only when the user click on the create button:

Error message displayed.png

Max Lim _Adaptavist_
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.
August 1, 2022

I didn't see that you just need for a single parent issue type. You can use:

issue.parentObject?.status.name != "Done" || issue.parentObject?.issueType.name != "Story"
Venkata Sagar August 1, 2022

Hi @Max Lim _Adaptavist_ ,

 

Thank you for the Response, It is working as Expected .

Ryan Bullock September 7, 2023

We have a similar issue and the script is not working quite how we would like. We have a workflow with the issue types Epic, Task, and Sub-task. We also have a separate workflow with the issue type Request. The script is blocking the Sub-task creation as expected, but is also blocking the ability to create Epic and Tasks that follow the same workflow. Ideally we would like Sub-tasks to be blocked if the Request issue type is Closed/Done, but it is fine if it applies to all. Any ideas?

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.
August 1, 2022
Venkata Sagar August 1, 2022

Hi @Sreenivasaraju P ,

 

I have done those but it is not working!!

 

Thanks,

Sagar 

Venkata Sagar August 1, 2022

Hi ,

Could you please help me with correct solution and steps .

Thanks 

Venkata Sagar August 1, 2022

Hi , In Subtask workflow and in Create Transition ,I have added a validator  , that is Script Runner Validator 

import com.atlassian.jira.issue.Issue issue.getParentObject().getIssueTypeObject().getName() != 'Story'

 

But it is not working, Please Help me

thanks 

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.
August 1, 2022

Hi @Venkata Sagar ,

can you please try with below workflow property at close status.

jira.issue.editable = false

Venkata Sagar August 1, 2022

Hi @Sreenivasaraju P ,

 

But , i need for specific issue type ,So how can i meet that criteria with this workflow property. 

And i think this property won't provide to edit the issue 

Please Help me

Thanks 

Sagar

Suggest an answer

Log in or Sign up to answer