How to prevent transition unless sub-task exists

Kevin Stark April 9, 2013

Is there any way to prevent a transition unless the issue has at least 1 subtask? I'm trying to prevent users from transitioning user stories through the story workflow until at least 1 subtask has been created.

2 answers

1 accepted

1 vote
Answer accepted
Henning Tietgens
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.
April 9, 2013

You could use the Script Runner plugin with a simple scripted condition:

issue.subTaskObjects?.size()>0

Henning

JamieA
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.
April 9, 2013

Or just:

issue.subTaskObjects

Henning Tietgens
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.
April 10, 2013

Ok :-) I was not sure if the API maybe returns an empty collection...

0 votes
Chaithra N
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.
April 9, 2013

If you want to a prevent particular transition (i.e Tranistion must not be availble to end User), then you will have to write Custom Condition for this and in Condition Class you can check if Subtask is available or not.

Suggest an answer

Log in or Sign up to answer