Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,708
Community Members
 
Community Events
165
Community Groups

Validate Child Issues are Closed before Parent Issue Can Be

Hi,

There seems to be build in workflow condition for this for 'sub-tasks' but our hierarchy is:

  • Initiative
  • High level Epic
  • Feature ( which replaces Epics ) 
  • Story
  • Sub Task

Ideally I'd like a solution for checking each child issue type(s) to be 'closed' / 'done', before the parent issue can be closed.

Any examples would be gratefully received, including using ScriptRunner.

Thanks,

Simon

1 answer

0 votes

Hi,

one way to achieve this is to use the "Linked Issues Status" Condition of the JMWE for Jira Server app. Only the Initiative to Epic constraint won't work, because Jira Portfolio doesn't use issue links for that. For that, you'll need a Scripted (Groovy) Validator with a short Groovy script:

!!jqlSearch( "\"Parent Link\" = ${issue.key} and status not in (Closed,Done)", 1 )

where you'll replace Close and Done with the statuses the child issues (e.g. High-level Epics of the Initiative) must be in.

Thanks for the reply David.

I was thinking there would probably be a solution with a plugin, but I was hoping there would be something 'out of the box'.

Regards,

Simon

@David Fischer _Appfire_

Hi David.  I have a similar problem.  In my case, we have "Feature" as the Parent (Parent Link) of an Epic. I want to prevent the Feature from moving to the In Progress status unless at least one of it's children is in the 'In Progress' status. How would the groovy script be crafted for that?

I also need to prevent the Feature from being able to transition to Complete unless all of its children are in either a Done or Deleted status.  I applied your script above in a "Scripted (Groovy) Condition (JMWE add-on) Condition" on the transition to Complete for the Feature. When I tested it, it didn't work. The transition was allowed when it should not have been. I'm sure the answer is obvious to someone who knows anything about groovy scripting, but that's not me. Since I'm using a condition vs a validator should I have used "in" vs "not in"?  I'd greatly appreciate your help.  Thanks!

To prevent the Feature from moving to the In Progress status unless at least one of its children is in the 'In Progress' status, this script should work:

!!jqlSearch( "\"Parent Link\" = ${issue.key} and status in (\"In Progress\")", 1 )

To prevent the Feature from being able to transition to Complete unless all of its children are in either a Done or Deleted status:

!jqlSearch( "\"Parent Link\" = ${issue.key} and status not in (Deleted,Done)", 1 )

which checks that no child issue is in any status other than Done or Deleted.

Hi David.  Sorry to be taking so long to respond but I was on vacation. I just wanted to thank you for you help. The code you provided worked perfectly!  I don't know how anyone could get by without the JMWE Add-on.

 

Thanks!

Hi @David Fischer _Appfire_ ,

Thanks for the response, sounds like your plugin does what we need, albeit with a little bit of scripting.

Can you confirm what licence tier we'd have to purchase at please? We currently have 2,000 JIRA server licence, although only about 500 are used, would we have to match that? I'm not sure there would be sufficient benefit for the functionality to warrant $2K per annum.

Regards

Simon

Hi Simon,

licensing for JMWE works the same way as for any Jira app sold on the Atlassian Marketplace: the license tier must match that of Jira itself. 

I understand that purchasing JMWE for a single feature might be overkill. However, I believe JMWE actually has much more to offer so you might want to read a little about its other features.

Regards,

David

David,

Is there a way to do this with JMWE in JIRA Cloud?

 

Jeanne

Unfortunately not, because Jira Cloud doesn't support custom Validators added by apps (except for completely static ones).

Hi all, I've managed to implement the following use cases in JMWE for Cloud:

1) Trigger "Transition on Linked Issues" to automatically put the Parent "In Progress" when the first child goes to "In Progress".
2) Trigger "Transition on Linked Issues" to check if all the children are "Done" so that we can move the Parent to Done too automatically.

By applying these rules to the entire hierarchy we are using Initiative->Feature->Epic->Story->Subtask, we are somehow assuring that the Parent only goes to In Progress when the first child goes to and gets Closed only when all the children get Closed too. (this scenario you can actually achieve through a validator too).

Please reach out if you need further help on this type of issues.

Like andriano zg likes this

Hi,

JMWE Cloud now offers conditions and validators. So you might want to try them to simplify your workflow.

Regards,

Radhika

Thanks @Radhika Vijji _Innovalog_ for your feedback.

So, can you give a concrete example of how would that look like if I want to validate:
1) That at least one child issue is in progress while trying to move the parent.
2) That all children are closed before being able to close the parent.

I kindly ask you to be specific about the options / scripts used for the purpose.

Thanks,

@Rui Ferreira @Radhika Vijji _Innovalog_   Do we have any option to restrict the closure of Capability  using the JMWE validator / any script validator 

We are looking to close the Capability only when all epics are closed . We use JIRA cloud

Hi @Annamalai_ Krishnapriya ,

I assume Capability is an issue type above Epics in your Advanced Roadmap hierarchy? If so, there's unfortunately no way at this time to access the hierarchy from Jira Expressions, which is the only way to write Validators in Jira Cloud. This is a Jira Cloud limitation: https://ecosystem.atlassian.net/browse/ACJIRA-1766

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

332 views 0 7
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