Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting creation of Sub-task to specific parent issue type

Gregory Kremer
Contributor
October 6, 2022

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.

1 answer

1 accepted

1 vote
Answer accepted
Adam Rypel _MoroSystems_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2022

Hello @Gregory Kremer ,

Yes, the suggestions you are referring to are related to server environments. In Cloud, you have to use Jira expression, which is described here: https://developer.atlassian.com/cloud/jira/platform/jira-expressions/

In your case, the validator would look like this:

issue.parent.issueType.name == "Program"
Gregory Kremer
Contributor
November 9, 2022

Thank you very much. Appreciate your reply.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events