Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Next-gen Automation: Target epic's linked issue correctly if there are multiple linked issues

Edited
Daniel I'm New Here Dec 06, 2021

Note: This is for Jira Next-gen, not Jira Classic.

Hello.

I'm currently doing some complex recursive automation between two sets of child-epic pairs in different boards. 

The desired scenario is the following: 

issuelink.png

The way in which I'm currently achieving this is the following: 

  • STEP 1: If standard-level issue in BOARD A has a linked issue in BOARD B.
    • STEP 2: If the linked issue in BOARD B has no epic. 
      • STEP 3: If standard-level issue in BOARD A has an epic. 
        • STEP 4: If standard-level issue's epic in BOARD A has a linked issue (issuelinks.outwardIssue.key). 
          • STEP 5: Assign standard-level issue in BOARD B to the BOARD A epic's linked issue (issuelinks.outwardIssue.key) - which should ideally target the epic in BOARD B. 

The way in which I'm editing the standard-level issue in STEP 5 in order to assign it to its intended epic in BOARD B is by using the following advanced field: 

{
"fields":{
"Epic Link": "{{triggerIssue.parent.issuelinks.outwardIssue.key}}"
}
}

This works fine, but the problem that I'm having is that if the epic in BOARD A has multiple linked issues, issuelinks.outwardIssue.key will often select the wrong linked issue when the intended linked issue is the one in BOARD B. 

The desired effect is that issuelinks.outwardIssue.key would select a linked issue of a specific type ("clones"/"is cloned by") in order to differentiate it from other linked issues (such as "blocks", "relates to" etc.). 

Anyone know how I can achieve this? 

Thanks in advance. 

1 answer

Hi @Daniel -- Welcome to the Atlassian Community!

If I am understanding your use case correctly...

First thing, nextgen (now called Team-Managed Projects) cannot have multiple boards yet.  That means you are talking about linking/updating issues in different projects and that requires a global / multi-project rule.  Correct?

Next, to do what you ask you could use an advanced JQL statement to find your issue for the link: https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-linkedIssueslinkedIssues--

For example, and I am assuming your trigger issue is the standard issue in Board A:

issue IN linkedIssues( {{triggerIssue.parent}} , "clones") OR issue IN linkedIssues( {{triggerIssue.parent}} , "is cloned by")

 

Kind regards,
Bill

Daniel I'm New Here Dec 09, 2021

Hello, 

Yes, these are global automation rules. 

Regarding your suggestion, I unfortunately don't see how it applies to my particular problem. 

I'm not asking for help to run a JQL query. I need help figuring out how to only get a specific link type when using using trigger.Issue.parent.issuelinks.outwardIssue.key.

It's the process of assigning an Epic Link that is the problem here: 

{
"fields":{
"Epic Link": "{{triggerIssue.parent.issuelinks.outwardIssue.key}}"
}
}

Because if "issuelinks" contain more than one link, then this will sometimes fail. 

I need to somehow make sure that the above mentioned smart value can be qualified for a specific type (in this case "cloned" and "is cloned by"). 

As far as I know, there's no way to fix the problem by applying a JQL query in my described scenario. 

Hi, Daniel.

Yup, I got what you were trying to accomplish, and sorry I didn't clarify my suggestion better.  The issuelinks from the Parent have only the key, and not the rest of their data, such as linktype.  If all of that data was present, you could use list filtering to do what you asked.

As that is not possible, I was suggesting gathering the issues using JQL on the trigger issue key and the link type you want (perhaps with Lookup Issues).  And then use the results to get the specific epic you want for the link.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

752 views 23 28
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