Need to update a custom field based on the resolution status of linked tickets.

We have a business requirement to update value of a custom field in a JIRA project based on the resolution status of all linked tickets. So when all the linked tickets are resolved, we have to update the value of the custom field to resolved. Otherwise, even if one of the linked tickets is not resolved, the value of the custom field will remain 'In progress'.

 

We have a project called "Escalations" where a business user can create an issue, for example JIRA number "ES-20". We have a custom field, "Resolve Status" in Escalations project and the moment ES-20 was created, the value of "Resolve Status" was set to "In Progress".

Now, upon investigation by development team, they decide that ES-20 actually is a bug in software and will require changes to backend as well as frontend. We have a separate project for backend (BE) and separate for frontend (FE). So they decide to create 2 issues in backend project (BE-31 and BE-32) and 1 issue in the frontend project (FE-44). Then they link these 3 issues to ES-20. So ES-20 now has BE-31, BE-32 and FE-44 linked to it. Development teams then separately start fixing the issues and once all 3 issues are fixed they mark it resolved. The moment BE-31, BE-32 and FE-44 (all 3 of them) are resolved, the value of "Resolve Status" custom field on ES-20 is updated to "Completed". The status of ES-20 will then later of be set to Resolved, manually by development team. Is it possible to update the value of "Resolve Status" custom field?

2 answers

I think this could be done without much code using workflow trickery and the Misc. Workflow Extensions plugin. To simplify, i'll call the issues Child and Parent. I'd investigate something like this:

  1. In the child issues workflow, create a post-function in the transition that leads to the status where the issue is resolved. That post-function should try to transition linked issues through a specific link that you set up between the parent and child issues.
  2. In the parent issue's workflow, create a transition to set the resolution of the issue, and add a post-function. That post-function should set the resolution to Completed. It's not necessary to have the transition lead to another status by the way. A transition from "In Progress" back to "In Progress" is possible.
  3. That transition should have a validator to prevent the transition if all linked issues are not resolved (either a value in the Resolution field, or in a Resolved status). Not 100% sure this part can be done with a validator though. I'm sure it works with subtasks, but linked issues i'm not sure. Perhaps a Groovy condition in the post-function would do the trick.
  4. Add a condition to hide that transition from users, since it's only meant to be called through automation.

So basically, you want the child issues to try and transition the parent issue when one of them is resolved, and you want the parent issue to validate it can transition, or to prevent the resolution from changing at least.

 

Excellent answer.

Thank You Nicolas. This looks like a promising solution. We will give it a try and see how far we get. Really appreciate your help and the quick response...!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

63 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you