It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

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. 

0 votes
Answer accepted

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

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. 

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

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. 

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
Community showcase
Published in Jira Software

[New] Jenkins for Jira Software Cloud and a way to connect your hosted apps

Jenkins is the leading open-source automation server used by startups and enterprise teams to build, test and deploy code to production.   We are excited to announce an official integration betw...

2,134 views 1 19
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