Forums

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

How to restrict subtask types to certain task type

Martin Vali
Contributor
May 29, 2025

image.png

2 answers

0 votes
Cristiano Alves -Appfire- May 29, 2025

Hello @Martin Vali 

 

Cristiano from the Appfire Team here.

 

This should be possible using our tool, Jira Misc Workflow Extension (JMWE).

You may set up a validator on the "Create" workflow with specific conditions with your own validator.

Just select the option "Build-your-own Validator (JMWE app)" and select the JQL code option.

the code should look something like this:

issue.parent && issue.parent.issueType.name == "Story"

I used story as an example, but you are able to select any issue type available in the project scheme.

Then you check the box "Conditional validation" with the code:

issue.issueType.name == "Sub-task"

This guarantees that only sub-tasks fall into the condition, and other issue types are created normally.

Here is a screenshot of it.
Screenshot at May 29 3-47-04 PM.png

You are also able to put the "Conditional" inside the code, that way you may add more to it.

// Only apply to subtasks 
if (issue.issueType?.subTask) {
// For subtasks: require Story parent
return issue.parent && issue.parent.issueType.name == "Story"
} else {
// For non-subtasks: always allow creation
return true
}

 

Feel free to contact our support team if you have any doubt.

Regards,

Martin Vali
Contributor
May 29, 2025

@Cristiano Alves -Appfire- thanks , Will concider your app

0 votes
Jack Brickey
Community Champion
May 29, 2025

Hi @Martin Vali , I am not sure I follow your question exactly. When you create a new issue type you can decide if it is at level 0 (standard) or -1 (sub-task). 

IMG_5798.jpeg

Jack Brickey
Community Champion
May 29, 2025

Oh...I think you are asking how to restrict the association of different sub-task type to the parent work item type. So that you can't add some sub-task types to some parent types.

I believe this can be accomplished in CMP project workflow by using the issue.parent.issuueType.name property on the Create transition. Disclaimer- I have not tried this in a long time.

Like Martin Vali likes this
Jack Brickey
Community Champion
May 29, 2025

Hmmmm... Actually that is inaccurate...my memory is failing me here. Let me play with this a bit....

Jack Brickey
Community Champion
May 29, 2025

I researched this a bit more and unfortunately I don't think this is possible OOTB. I expect there are solutions using third-party apps.

Like Martin Vali likes this
Martin Vali
Contributor
May 29, 2025

@Jack Brickey thanks for trying

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