Prevent Converting standard Issue to Sub-task

Ismael Jimoh February 28, 2025

I would like to prevent users from converting a parent issue to a sub-task if the selected parent when converting the ticket is already closed.

I have tried with a validator but this didn't stop the following from proceeding.

 

if(parentIssue.getProjectObject().getKey() == 'projkey'){

// Check if the parent issue is closed

if (parentIssue != null && parentIssue.getStatus().getName() in ['type1', 'type 2', 'No Issue']) {

throw new InvalidInputException("You cannot create a subtask because the parent issue is closed.")

return false

}

}
So while this works when a user is creating a new sub-task from the parent issue, it doesn't prevent a user from converting a parent issue into a sub-task and selecting the closed issue as the parent.
How could I check this  to prevent this?
Thanks in advance

1 answer

1 accepted

1 vote
Answer accepted
Lucas Modzelewski _Lumo_
Atlassian Partner
February 28, 2025

I've not used this against moving issue, but maybe you can try with workflow properties:

jira.issue.
editable

Make an issue editable when it has a particular status. By default, if this property isn’t set, issues are always editable.

true
Disable editing when an issue has a particular status. This may be helpful when the issue is at the final stage of the process and has some of the finalizing statuses like Done. false

Source: https://confluence.atlassian.com/adminjiraserver/workflow-properties-938847526.html

Let us know if it worked

Ismael Jimoh March 2, 2025

Thanks a lot @Lucas Modzelewski _Lumo_ .

That solved the issue.

Screenshot 2025-03-03 at 07.07.41.png

I really appreciate the quick response.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.27
TAGS
AUG Leaders

Atlassian Community Events