Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

SJ November 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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
BenP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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 _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 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.

Like Kedar Kanel likes this
Vincent de Regnauld de Bellescize November 1, 2017

It works, thanks @BenP and @MarkM

osvaldo plabst May 3, 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
Jitendra Kashyap September 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 November 9, 2018

Hi @BenP 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 _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2018

Hi @manivigno, 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 November 11, 2018

@Mark McCormack _Adaptavist_ @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.

0 votes
Dmitry Miroshnichenko
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2014

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 $)

TAGS
AUG Leaders

Atlassian Community Events