Epics, like all Jira Issues are based around a workflow, but keeping statuses up to date can be a real chore, here's a tip...
Epics are really useful for grouping Stories together, as well as for planning and prioritising work. Like all Jira Issues they are based around a workflow, so you can see which Epics haven’t been started, which are being worked on and which have been completed. However keeping Epic workflow statuses up to date can be a chore, so often Epics are left in their start status even if all child issues have been completed. This tip shows you a configuration for automatically keeping the Epic status up to date depending on the progress of linked Issues.
Out of the box Jira doesn’t have the capability of doing what I’m going to show you, so you will need a Marketplace App. For this example I am going to use JSU Automation Suite for Jira, but you can use Misc Workflow Extensions (JMWE), or Automation for Jira instead.
Epics are going to need their own workflow for this solution, create a workflow similar to the one shown below, and remember to associate the workflow with the Epic Issue type in the Workflow Scheme.
Below is a simple Issue workflow, the two transitions that are important are the transition to “we’ve started working on this issue” status, and the “we’ve finished here” status. I’ve marked these with numbers, and for both of these Transitions, we will add a Post Function.
What are Post Functions?
Post functions are automations that are fired after a transition has been successfully completed, they are often used to set values, assign issues or even create new Issues.
1. To In-Progress Transition.
We need to add a post function to this transition, click on the Post functions link, followed by Add Post Function. A screen will be displayed, giving us the choice of which Post Function to use.
Choose the Linked Transition (JSU) Post Function, this useful function will Transition the Epic for us.
We need to fill in some details on the Post Function form:
Needs to be set to Epic (Issue in Transition must be in Epic).
Choose the Epic Workflow in the first drop-down, then choose the name of the Transition that moves the Epic into an ‘In Progress’ status.
2. To Done Transition.
Click on the to Done Transition, marked by (2) in the diagram, add a Post Function, and choose Linked Transition (JSU) once again.
Needs to be set to Epic (Issue in Transition must be in Epic)
Choose the Epic Workflow in the first drop-down, then choose the name of the Transition that moves the Epic into ‘Done’ status.
All Other Siblings
If an Epic is linked to multiple Stories we don’t want to complete the Epic just because one Story has finished, we want them ALL to be Done. Setting this field to Done (or whatever your finished status is) checks that all the related child tickets are in the correct status before the transition is fired.
Note: If you have a rejected status as well, you need to make sure that both Rejected and Done are selected in the list of statuses.
Don’t forget to publish the workflow, then you can test that the automations work correctly. Creating an Epic and a couple of linked Stories. Move one of the Stories into In Progress, and watch the Epic magically move into In Progress. Move both the Stories to Done and check that the Epic also moves to Done — viola!