Forums

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

Link issue to existing EPIC

jbeg
Contributor
May 27, 2021

Hope someone knows a way to resolve the following task:

Trigger: Rule is triggered when an issue is transitioned from status A to B.

What should the rule do: If an EPIC (in this case with the same name as the issue) exists, link the issue to the existing epic.

Problem: Via edit issue and selecting the field Epic-Link i can only choose

  • Current issue
  • Parent issue
  • Epic issue
  • Trigger issue

I assume that none of these is the right one . So I figured that i could use the advanced option to manually set the epic-link - but this only works with the issue key of the epic - not the name. 

{
"fields": {
"Epic-Link": "{{issue.summary}}"
}
}

So, either I need a way to get the Epic issue key or a different approch to this problem.

 

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
May 27, 2021

Hi @jbeg 

For a question like this, please consider posting an image of your complete rule and an audit log entry from a failed run.  That will provide the community some context to try to help.  Thanks!

You do not indicate if you are using Jira Cloud or Server/Data Center, so I am going to assume for now "Cloud"...

  • Trigger: issue transitioned from A to B
  • Action: lookup issues on JQL to find the desired epic
  • Condition: {{lookupIssues.size|0}} = 1
  • Action: edit the issue to set the epic link to {{lookupIssues.key}}

When adding the value to the edit, type in the value {{lookupIssues.key}} and it will appear below the field, then select it to use the smart value.

Best regards,

Bill

jbeg
Contributor
May 28, 2021

Hi Bill, 

thank you very much for the reply. We are using Jira Server - so if I am not mistaken, the lookup feature is not available. 

This would probably solved my quesion the way you described it. Unfortunately this feature ist not available on server https://jira.atlassian.com/browse/JIRAAUTOSERVER-53

Are there any other solutions?

Bill Sheboy
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.
May 28, 2021

Hi @jbeg 

For server without Lookup Issues, how about a slower work-around using the bi-directional nature of issue links...

  • Trigger: issue transitioned from A to B
  • Branch: on JQL to find the desired epic matching your criteria
    • Action: add a link of a type you do not use to the trigger issue.  Perhaps, split from/to
  • Action: re-fetch to reload the trigger issue's data and see the added link
  • Action: edit issue to set the epic link to the key value in the specific link added.  You may need to use a regular expression to yank out the key

Please note that I haven't tried this as I do not have server version, so let me know how this works (or doesn't ;^)

__Bill

jbeg
Contributor
May 31, 2021

Hi @Bill Sheboy ,

this was a quality answer! Thank you very much!

It is quite a workaround and complex for just such a simple task - but for the server version quite nessescary as it looks. 

I got the link key from {{issue.issuelinks.first.outwardIssue.key}} so no regex magic was needed.

Thanks again for your help

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events