It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to Restrict Creation of Subtask based on IssueType in JIRA ??

Senthil J Nov 27, 2014

Hi,

How to restrict creation of subtask based parent issue type. ?? If its issue type 'A' i dont want people to create subtask for it. Issue type 'A' is main issue type.

In the UI itself i dont want to see a link to create subtask.

 

Help me !!!!!

3 answers

1 accepted

4 votes
Answer accepted
Ben De Pauw Jul 29, 2015

See https://jira.atlassian.com/browse/JRA-7990, where Denis Yaparov has provided a nice solution via (script runner) simple validation on Create issue transition's validator event

 

This simple scripted validator on Create transition in sub-issue workflow could do required check:

["Task", "Bug"].contains(issue.parentObject?.issueTypeObject.name)

 

 

Mark McCormack Aug 26, 2016

Thanks for providing this answer Ben ....

And for those trying to get it working for JIRA 7 the syntax has changed slightly to:

["Task", "Bug"].contains(issue.parentObject?.issueType.name)

regards, Mark.

osvaldo plabst May 03, 2018

hi ! i'm having issues with this.. how does it work? 

Between [] goes the parent issue type?

i did that but it doesn't work for me ! i have jira 7.6 by the way..

Mani Reddy May 17, 2018

@osvaldo plabst By entering Task, Story between [ ] you are limiting which issue types can be used to create sub-tasks. 

 

For Example if you type "Epic" between [ ], you are only allowing sub-task creation under Epic and restricting sub-task creation under all other issue types.

naga ravi May 26, 2018

Ben

Thanks for your answer. I have one issue in this

This script will run different workflows for different sub tasks.

in my case i have same workflow for all sub-task types how i need to modify this script.

0 votes

Hi! If you have sources - you can override jira-quick-edit-plugin. If you don't - I have bad news for you https://jira.atlassian.com/browse/JRA-7990 . So, you can hope they will make it after some years $)

0 votes
Jitendra Kashyap Sep 25, 2018

Hi All,

 

I am trying to implement script validation for JIRA v 7.8.2

 

We have created specific Sub tasks ad need to restrict creation of sub tasks only under specific 

Say sub task is SUBTASK A   and task is TASK ONE

i have defined Workflow for SUBTASK A and am trying to implement Validator during creation.

my syntax is 

 

["TASK ONE"].contains(issue.parentObject?.issueType.name)

 

I am getting required error message even when I am trying to create Sub task  under TASK ONE.

Please suggest what could be wrong as I think the TASK ONE name is not getting validated.

Mani Nov 09, 2018

Hi @Ben De Pauw and @Mark McComark,

Above scripts are not working in my Jira(7.12.3 version) could you help me on this please.

Thanks in Advance,

Manikanta

Mark McCormack Nov 10, 2018

Hi @mani, could you please create a ticket on our Product Support Portal and include the script(s) that is no longer working as well as details on the version of Jira you upgraded from (and to Jira 7.12.3).

Also, please include any relevant log(s) or errors (if any).

Thanks in advance, Mark.

Jitendra Kashyap Nov 11, 2018

@Mark McCormack @Mani  I have worked out on the script and made it work for our JIRA

 

Please use this in Validator  for create transition in the workflow.

 

issue.parentObject?.issueType.name in ["XXXXX']

where XXXXX is the name of your parent issue type.

 

please make sure that there are no spaces in the name before and after the alphabets.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Handling Opsgenie Alerts

Hi everyone, welcome to the kb articles for Opsgenie FAQs. I'm one of the Technical Support Engineers for Opsgenie who will be providing weekly posts on FAQs from customers.   All alerts are ...

10 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you