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