Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Linking Bugs to related to Epics - Automation

louise.simmonds November 16, 2022

Hi,

Hoping somebody can assist with this!

Jira Cloud - Company Managed project

The problem I am trying to solve is how to automate linking of Bugs to the Epic they belong to (based on the Story they are linked to). We have been linking Bugs manually to the Epics because we wanted to have a view for any given Epic, which Bugs relate to it.

We are using the following hierarchy/linking:

  • Epics with Stories as children
  • Bugs linked to Stories (Blocks)
  • Bugs linked to Epics (Blocks)
    We are taking the additional step of linking Bugs to Epics so that for each Epic we have an easier view of which Bugs are blocking the Epic rather than having to drill down through each Story

I have been looking for a way to automate the linking of Bugs to the relevant Epic but so far unsuccessful. The business logic would be as follows I think:

  • When a Bug is linked to a Story
  • If the Story is linked to an Epic i.e. has a parent Epic
  • Then link the Bug to the same Epic using “blocks” link type

Thanks in advance!

1 answer

0 votes
Trudy Claspill
Community Champion
November 16, 2022

Hello @louise.simmonds 

Can you show us the rule you have tried to build and tell us how it is not meeting your needs? Also, please show the Audit Log for the execution of the rule.

Trudy Claspill
Community Champion
November 16, 2022

I have a rule that works for this, but I'd like to help you learn by helping you debug what you have.

louise.simmonds November 16, 2022

Hi - thank you, I don't have any rule at the moment. My automation experience in Jira Software Cloud is limited as I have spent most of my time on Server!

Trudy Claspill
Community Champion
November 16, 2022

Ok, well, I encourage you to take a look at the documentation:

https://support.atlassian.com/jira-software-cloud/docs/automate-your-jira-cloud-processes-and-workflows/

...and maybe set up a test project where you can experiment with rules. There is a library of prebuilt rules that you can reference also. 

You picked a tricky rule for your first attempt! :-)

I'll summarize the steps:

TRIGGER: WHEN an issue link is created of the Link Type "blocks"

...add other conditions to make sure you want to continue
CONDITION: the type of the issue causing the block is Bug
CONDITION: the type of the issue being blocked is Story
CONDITION: the blocked Story has a parent Epic

ACTION: Create a link of type "blocks" between the Bug and the Epic

 

What makes this tricky is that the Issue Linked trigger concerns two issues, and you have to understand how to reference each issue in the Conditions and Actions of the rule. The trigger gives you an explanation of this:

Screen Shot 2022-11-16 at 10.56.39 AM.png

You will have to use the Smart Value (things in curly braces) in the Trigger description later to reference information in the Bug and Story issues that were linked.

(I'm going to post this in pieces as it will take me a while to write it all down.)

Trudy Claspill
Community Champion
November 16, 2022

(Part 2)

I like to use the Log action to print values to the Audit Log for the Rule so that I know what values the rule is working with.

We want to confirm that the issue causing the Block is a Bug, and the issue being Blocked is a Story. Referencing the description of the trigger, the issue causing the block can be referenced with the {{issue}} smart value, and the issue getting blocked can be referenced with the {{destinationIssue}} smart value. So, I log the values for the Issue Keys and Issue Type of each of those.

Screen Shot 2022-11-16 at 11.02.05 AM.png

 

Next I log the value for the blocked issue's Epic Link field.

Screen Shot 2022-11-16 at 11.03.48 AM.png

 

When the rule is run, you'll be able to see all this information in the Audit Log.

Screen Shot 2022-11-16 at 11.05.25 AM.png

Trudy Claspill
Community Champion
November 16, 2022

(Part 3)

Next we add the conditions to check that the event that triggered the rule was a link created between a Bug and a Story.

Screen Shot 2022-11-16 at 11.08.10 AM.png

Screen Shot 2022-11-16 at 11.08.42 AM.pngScreen Shot 2022-11-16 at 11.08.54 AM.png

 

And then check that the blocked issue has a value in the Epic Link field (which is where the issue key for the parent Epic is stored).

Screen Shot 2022-11-16 at 11.10.01 AM.png

 

If those three conditions pass, then the next step in the rule will execute - the action to create a link between the Bug and the Story's parent Epic.

Screen Shot 2022-11-16 at 11.11.12 AM.png

 

Screen Shot 2022-11-16 at 11.11.46 AM.png

 

To make this a little simpler to read, here is the rule without all the Log actions.

Screen Shot 2022-11-16 at 11.13.04 AM.png

louise.simmonds November 18, 2022

Thank you so much for taking the time to respond in such detail! Appreciate it is a complicated automation to attempt as a newbie to automation in Cloud :-) 

I'll replicate and will let you know how I get on.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events