Automation to Link Issue 1 to the Parent Issue (Issue 3) of Issue 2

Rebekah N. December 8, 2020

In our Jira we have things set up like this:

Feature Issue in Project #1

>Epic Issue in Project #2

>>Risk Issue in Project #2

The Epic issue is linked to the Feature issue in a Parent/Child relationship. While working on the project, we will add Risks to the Epic issue using a Risk relationship ("Exposes risk to"/"Incurs risk from"). The goal is to have this Risk automatically linked to the Feature issue using a Risk relationship at the same time.

I have used the Automation system to monitor for any time the Risk issue link type is used and, if the destination issue type is also a Risk, run an action that's intended to link the Risk issue to the Feature Issue via the Risk issue link type, as well, but I'm having issues making it happen in a targeted manner

I either can't get it to work at all or I can get it to link to all of the issues linked to the Epic issue, but we have other issues linked to the Epic via other link types; there is only ever a single Parent/Child link assigned to the Epic, though, so if I can target that link type specifically I could get this to work the way we need it to.

I know that I'll need to write some JSON to accomplish this and I can find examples of how to add issuelinks that way, but I can't find anything about how to target it properly.

2 answers

1 vote
John
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 15, 2020

Hi @Rebekah N. 

Can I confirm the feature issue and epic issue are in different projects? I didn't think it was possible to have a cross project parent/child relationship (unless this relationship is a type of linked issue?)

I'm also a little bit hazy on what the goal is. I'll state my understanding to provide context to the suggestion below. When 2 risk issues are linked you want to automatically link them to any feature issue that is linked to either of the risk issues. I'm a bit lost on how the epic fits into all of this?

When you're liking 2 risks issues you could try something like this (I've used the bug issue type in replacement of risk and the story issue type to replace feature)

Screen Shot 2020-12-16 at 1.03.38 pm.png

  1. Trigger the automation when a specific link type occurs (if this link type only occures between 2 risk issues you might be able to skip the next two conditions)
  2. Check if the issue type is a risk issue using the issue field condition(I've used bug in the example)
  3. Check if the destination issue (the issue that was linked) is a risk issue as well using a related issue condition. You want to check if linked issues with link type exposes risk has some issues that match JQL. The JQL would look something like this key = {{destinationIssue.key}} AND issuetype = Risk
  4. If all the condition above are met (meaning both issues are a risk issue) then perform a lookup issue. The JQL will look something like this (issue in linkedIssues({{issue.key}}, "blocks") OR issue in linkedIssues({{destinationIssue.key}}, "blocks")) AND issuetype = Feature
  5. Use the link issue action and input the smart value from the lookup issues action {{#lookupIssues}}{{key}}{{/}}
  6. Branch the rule for the destination issue
  7. Again use the link issue action with the same JQL

The reason I put 2 link issue actions is I assumed that each risk could have a feature linked so you would want to update both risk issues with the missing feature link.

Hope that helps

- John

Rebekah N. December 16, 2020

Thanks for checking on on this John! We changed the way we're approaching this situation so the issue I'm having is no longer happening, but I'll provide some additional context since I think you're getting close to what I would have needed before and someone else might need to know.

  • The relationship between the Epic and Feature is a linked issue type, which is probably what is leading to the confusion.
  • The goal was that any time the Risk linked issue type was used in Project #2, if the destination issue was issuetype Risk it would run the automation.
  • The instructions to the user were to manually link the Risk issues to the Epic in Project #2 on creation, so the automation would then take the further step of linking it to the Feature in Project #1 the Epic was linked to via the Parent/Child linked issue type.

It might help if I explain some of the terminology used a bit:

Risk - Actual risk to the project; created within my team's Jira project.

Epic - The method of tracking the project for my team; created within my team's Jira project. Will have a linked issue relationship with the Feature, as well as Epics from other teams.

Feature - The method of tracking the project for the whole department; created within the department's Jira project. Will have a linked issue relationship with Epics from multiple teams.

The idea is that our standard team members are just working in our project and the automation is taking care of linking the project risks into the departmental tracking system.

0 votes
Marco Brundel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 9, 2020

Hi @Rebekah N. ,

When you view a Feature, you want to see at a glance which Epics and associated Risks there are?
Could the Issue Matrix add-on be an alternative?

https://marketplace.atlassian.com/apps/1212709/issue-matrix

Regards,

Marco

Rebekah N. December 9, 2020

Hi @Marco Brundel ,

Unfortunately, additional add-ons are not an option I can explore at this time; thanks for the suggestion, though.

Like Marco Brundel likes this

Suggest an answer

Log in or Sign up to answer