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

Restrict type of subtask that can be created for a given parent type

Chris Bland December 17, 2014

Hi, I'm fairly new at this. There seem to be a variety of approaches - some guidance as to what would be best would very helpful.

This is for a plugin we are developing. We have two custom issue types, A and B (a subtask).

A will only have subtasks of type B. Equally, type B subtasks will only be able to have a parent of type A.

I would like us to be able to restrict the creation of subtasks, to achieve this.

Preferably, in the Create Subtask Issue Type dropdown, I would like to get rid of all other choices. 

However, if I have to use validation, then a message telling the user to pick another type, this would be OK.

Has anyone got some thoughts on the best way to achieve this?

Many thanks.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
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)

 

 

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 18, 2014

You can certainly do that with a validator like Conditioned validator from Update on Transition for JIRA. It would just give a use message when something you don't want was tried. It doesn't prevent the option from showing up.
I suspect there may be easier or more complete ways to do this, but I don't know off hand. 

Chris Bland December 18, 2014

Thanks for that - this is going into a plugin for the marketplace, so we really need it to be in code, with the minimum of dependencies.

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 18, 2014

Oh, sorry, I missed that in my reading. I don't really have a suggestion then.

Chris Bland December 18, 2014

I should have made that clearer - thanks for responding though.

TAGS
AUG Leaders

Atlassian Community Events