I have tried a few suggestion, posted on the Forum, to limit sub-task issue creation, based on parent issue issue type.
The first one was suggested here: https://community.atlassian.com/t5/Answers-Developer-Questions/Restrict-type-of-subtask-that-can-be-created-for-a-given-parent/qaq-p/555827 ):
This simple scripted validator on Create transition in sub-issue workflow could do required check:
["Task", "Bug"].contains(issue.parentObject?.issueTypeObject.name)
Mine looked like this:
["Program"].contains(issue.parentObject?.issueTypeObject.name)
It gave me this error:
There was an error during the execution of your Jira expression
Message:
Jira expression failed to parse: line 1, column 1:
let, IDENTIFIER, ;, !, -, typeof, (, null, true, false, NUMBER, STRING, TEMPLATE_LITERAL, new, [ or { expected, encountered.
Then I've tried another solution, suggested here: https://community.atlassian.com/t5/Jira-questions/How-can-I-disable-the-menu-options-for-Create-sub-task-and/qaq-p/805084
issue.getParentObject().getIssueTypeObject().getName() != 'Incident'
Mine looked like this:
issue.getParentObject().getIssueTypeObject().getName() == 'Program'
It didn't work either - the error message is too long to publish here.'
Could anyone please let me know what am I doing wrong? Is it because we are in Jira Cloud? I'd greatly appreciate any help. Thank you in advance.