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
}
}
I've not used this against moving issue, but maybe you can try with workflow properties:
jira.issue. |
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
Thanks a lot @Lucas Modzelewski _Lumo_ .
That solved the issue.
I really appreciate the quick response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.