How to have linked issue closed after all other linked issues are closed?

Jeremy Price December 3, 2019

I am trying to transition a linked Story ticket to a particular "Closed" status but Only when all of the other link Task tickets are closed. 

 

For example I will have 3 Tasks tickets that are Blocked by one Story ticket. I would like to have the Story ticket automatically moved into the Closed status once the last linked Task ticket is Closed as well. 

I currently have Jira Misc Workflow extension and also Jira Workflow Toolbox added on my environment.  I can use JWT to get the one to one linked issues transitioning just fine. However when I want to Story ticket to only transition once all of the linked Task are completed I can't figure that portion out with either of those apps. 

2 answers

2 accepted

2 votes
Answer accepted
Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 4, 2019

Hi @Jeremy Price ,

with regard to JWT, I'd recommend having a look at the examples provided here: https://apps.decadis.net/display/JWT/Transition+issues

While there is no exact equivalent to your use case described, a high-level step-by-step guide could read as follows. Please note that the exact expressions are highly depending on your specific configuration, e.g. issues, issue types or issue links involved:

  • Since you want to react on closing one of your tasks, a Transition issues post function has to be added to your transition to Closed in your Task's workflow
  • Since the origin is your Task issue, you'll have to point towards the Story to be transitioned. This could be done by choosing Issue List in the Issue Selection Mode with a query like this:
    filterByIssueType(linkedIssues(),"Story")
  • Since you want to close your Story, select the corresponding transition in the Choose Action section for Execute Transition.
  • The final (and most tricky) part is the Conditional execution section. Since you only want to execute your transition once all tasks are closed, an expression might read like this:
    count(filterByStatus(linkedIssues("is blocked by",filterByIssueType(linkedIssues(),"Story")),"Closed")) = count(linkedIssues("is blocked by",filterByIssueType(linkedIssues(),"Story")))

What this last expression does: starting from your Task - select your linked Story - now starting from your Story select all the Tasks and check whether all of those linked Tasks are in the Closed status.

The example provided works best if there are no other linked Storys or Tasks involved. If there are additional issues, you'd have to be more specific with filtering the correct ones.

Cheers
Thorsten

Jeremy Price December 5, 2019

Thank you for this detailed answer, as I have tried this and I can get it to work when there is only one linked issues as you stated. I am however trying to have other linked issues involved.

For example I may have one STORY linked to 3 or more TASKS, then this automation won't work and I'm not skilled enough at coding to drill down to be more specific. So I'm not sure what else I would need to do in order to achieve that goal. 

 

Again thank you for all you assistance this far and I will continue to test out different theories on my side. 

1 vote
Answer accepted
Inna Gordin December 3, 2019

Hi Jeremy,

I believe this use case is described step-by-step by Rachel Wright: Automatically transition Jira issues (When all child issues are closed, automatically transition the parent so users don't need to do it manually.) https://www.jirastrategy.com/apps/automatically-transition-jira-issues

It is specific to Jira Misc Workflow Extensions (JMWE) and I hope this helps.

Inna

Jeremy Price December 5, 2019

Thank you for your response and it is a good option however it only pertains to Parent child transition automations.

As I trying to manipulate a Task and Story linked issue types and since Task and Story can't have a parent child relationship between each other that option won't work for me unfortunately. 

Inna Gordin December 5, 2019

The same approach will work in that case, but you'll need to use the Transition Linked Issues post-function instead of the Transition Parent Issue post-function, and the Linked Issues Status Condition instead of the Subtasks Blocking Condition.

Like Jeremy Price likes this
Jeremy Price December 5, 2019

When I look at my post functions option for JMWE I don't see a "Transition Linked Issues" option. I'm on the server version of 6.0.0. So that is probably why I don't see it. I will speak with my Server admin and see about getting this version upgraded. 

Thank you for this information. I will reply back once I've upgraded the app and tested out the theory. 

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2019

Did you upgrade JMWE recently, to version 6.2.0? If so, the post-function was renamed to "Transition Related Issues", and it covers of all sorts of relationships between issues (including issue links).

Like Jeremy Price likes this

Suggest an answer

Log in or Sign up to answer