Hi,
I am looking for a way to:
I have looked through the available conditions in my JIRA instance, and can't find anything out of the box that will help me, so I think I will have to script this in Groovy.
Any ideas on the best way to approach this?
**UPDATE**
The original question didn't mention that I was looking for a way to handle this transition for Epics and Stories.
@David Fischer provided a solution that works for both relationships, in the form of a workflow condition:
!issue.stories && !issues.subtasks
For the first requirement, you shouldn't use a Validator but a Condition, because otherwise the post-function that automatically triggers the transition will make the user-triggered transition (the one on which the post-function resides) fail as well. This is a long standing Jira bug.
For both requirements, you can use the JMWE app's "linked issues" condition and validator without any coding required.
Hey @David Fischer
Thanks for your reply. The only JMWE linked issues condition I can find requires ALL Sub-Tasks to be in the specified status(es) before the transition can occur. This means that when the Story won't enter an "In Progress" state until all of the Sub-Tasks are in-progress.
What I'm hoping to do is:
If the Parent has Children:
Hide the transition from the user, and have it triggered by a post-function when one of the children enters the "In Progress" state.
If the Parent does not have Children:
Allow the user to trigger the transition manually.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're right, your requirement is better served with a Scripted (Groovy) Condition with the following code:
!issue.get("subtasks")
However, this will also hide the transition from automated transitions, such as the Transition Parent Issue post-function you're probably using, so you'll also need to use the "Skip workflow conditions" option of that post-function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
I've tried what you suggested, but it's not really doing what I want it to do, as I want the script to work for all parent/children relationships (e.g. Epics that have Stories & Stories that have Sub-tasks).
The code I'm trying to play around with is this - which isn't working, for the same reason - is as follows:
if (issue.parent != null) false
if (issue.subtasks != null) false
else true
Also, the Transition Parent Issue post-function doesn't have a "skip workflow conditions" option. Perhaps that's in a recent version that I haven't upgraded to yet?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You didn’t mention earlier that you want this to apply to Epics and Stories. This relationship is completely different from the issue/subtask relationship in Jira. In Jira, “parent” really only applies to subtasks.
For example, the transition parent issue post-function will only apply to the parent/subtasks relationship. To transition the parent Epic of a Story, you need to use the Transition Linked Issues post-function with the “belongs to Epic” link type.
Likewise, if you want to hide the Start Progress transition on an Epic when it has Stories, the code will be different:
!issue.stories
Finally, the option to ignore conditions and validators was added in JMWE 5.6.0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer,
This works perfectly, thanks!
My apologies for not specifying that this should apply to both Epics & Stories. I will mark this as 'solved' and update the description of my original question for anyone else that is looking to do the same thing.
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Steve Beauchamp,
You may consider any of the following two options :
Hope this helps.
Thanks,
Swathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.