Linking Epics with Labels Via Automation

Curtis Hill November 15, 2023

Hey All,

 

I'm bulk creating sets of ~20 epics that are all interconnected to each other. I believe my best option would be to use the label field as the connective tissue between the epics. I'm currently using an automation rule that I kick off manually which searches for any issues that contain the first epic. Then I use a branch rule that reads JQL which identified the downstream Epic via a label. Lastly I'm using the "link issues" to try to grab all issues with the first label.

If I try this last step with just an issue key the rule runs successfully so I believe I have a syntax issue with how I'm trying to grab the epic in the final step. I'm currently using {{issue.labels.match("(EpicImport1)")}} to try to grab any epic with the label EpicImport1. 

Images attached are a small scale version of what I'm trying to do. Thanks in advance for any advice, alternatives, or solutions!

1.PNG2.PNG3.PNG4.PNG5.PNG

2 answers

1 accepted

0 votes
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.
November 16, 2023

Hi @Curtis Hill -- Welcome to the Atlassian Community!

To which issue are you trying to link with that rule action?

That field in the Link Issue action takes an issue key, but the match() function returns text you are searching for.  In this case, it could only be "EpicImport1" and that is not an issue key.

Do you instead want to link to the trigger issue?

Kind regards,
Bill

Curtis Hill November 16, 2023

Hi @Bill Sheboy

The info text below the link field says I can use a smart-value and I think that is what I need to use in this situation. I can't link to the issue that triggered the rule as that would just link my base epic to itself. Issue keys work technically but they require me to manually find the epic. Doing that doesnt really save me any time since I'm already in the epic and I could manually click the link button. Given the scale of the tickets I need to create and link that will not be a viable option. 

All that to say I think the smart field option is the way forward but I'm not sure how to build the connective tissue. My best guess was trying to detect a label but I'm not sure that is actually possible with the smart-value.

There is an example automation for linking an issue that is commented on to a ticket, which is close to what I'm trying to do. If this is possible I think I just don't know the proper syntax to do what I want to do. I added an image of the example automation rule below.

Thanks for your time!

7.PNG

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.
November 16, 2023

Okay, that looks better as the match result might be a valid issue key in a comment.

 

I was noting the literal value "EpicImport1" you showed is not an issue key, and so the linking could not work.

 

So...are you putting issue keys in the labels to do this, or are you using "tokens" to refer to an epic, such as "EpicImport1", which must then be found? 

Perhaps if you show some sample data that will clarify things for the scenario, with the keys, labels, etc.

Curtis Hill November 16, 2023

I'm not sure I fully understand but given the context the "token" approach sounds closest to what I am doing. Maybe this breakdown will provide more context?

 

If an Epic has label EpicImport1

Branch and use JQL to search for all epics with the label EpicImport2

Then Finish to Start Depended by link "Smart-value that can detect the label EpicImport1"

 

The goal is to link all Epics with the label EpicImport2 as downstream dependancies of all Epics that have the label EpicImport1.

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.
November 16, 2023

Thanks for clarifying that, and so...perhaps modify the scheduled trigger's JQL to be:

issueType = Epic AND labels = EpicImport1

And remove the condition testing for that label.

Then inside of the branch on the EpicImport2 epics, it could just link to the trigger issue.

Before that link attempt, you may want to add a condition to prevent re-linking if the link was already present.

Curtis Hill November 16, 2023

Updated my rule to this format and as far as I can tell its failing to find any valid epics within "link issues to" step. I think this smart-value is the source of the failure.

This is the smart-value I'm currently using in the link step. 

{{#issue.labels.contains("EpicImport1")}}{{/}}

 8.PNG9.PNG

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.
November 16, 2023

By changing the JQL for the trigger, there is no need to use a smart value in the link action.  Instead you can just link to the trigger issue(s), correct?

And as I noted earlier, any smart value used in the Issue Link action must be a valid issue key.  What you are showing will return true or false: it will not return a key to link to.

Curtis Hill November 16, 2023

Ah! That did it, I understand! Thanks Bill, very helpful!

Like Bill Sheboy likes this
0 votes
Alexis Robert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 16, 2023

Hi @Curtis Hill , 

 

looks like you're on the right track with the Smart Value to match this label, I'm wondering if maybe this is juste an issue with quotes. 

Could you try this value instead : 

 

{{#issue.labels.contains("EpicImport1")}}{{/}}

 

Let me know if this helps, 

 

--Alexis

Curtis Hill November 16, 2023

Hey @Alexis Robert, thanks for responding! When running with your value I'm getting this error. I know I have permission in my project so I suspect this value is not able to see the epic with the attached label. 6.PNG

Suggest an answer

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

Atlassian Community Events