Forums

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

Automation to link issues with specific labels

Akshay Shinde
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 17, 2020

Hi Guys,

 

Want to link my current issue to any specific issue/epic if any user adds a label to the story. For example, 

Label name: Release 1.0

If the STR-1111 card has a label Release 1.0, it blocks the STR-2222

How to achieve this via automation. Somehow it's failing with error: You cannot link an issue to itself.

1 answer

0 votes
JD
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 17, 2020

Hi @Akshay Shinde 

Thanks for using automation, I'll try to help you with your question. First up is the issue/epic you want to link to always the same one? Or would it be dynamic, and how would you know which epic to link to?

If it always the same one you could use an automation like this (in the example it will always link to the epic AUTOM8-32):

Screen Shot 2020-09-18 at 3.20.10 pm.png

Also I might be reading into your example too much (Label name: Release 1.0) but have you thought about using versions and releases instead of labels for this kind of tracking?

If you go to the Releases page you can create a version (e.g. Release 1.0) and then link issues to that version using the fix version field. This allows you to track your progress towards a release. You can also add automations to trigger when you release a version (e.g. send release notes of all the issue completed in a version).

Screen Shot 2020-09-18 at 3.25.27 pm.png

Hope that helps,
John

Matthew Day
Contributor
December 24, 2020

Hi John,
Actually, I'd like to link disparate tickets about log-rotation together so that when one of my team looks at one, they notice that there are others like it (linked via relates-to). 
Is there a way to do this? I'm new to automation and spent all day trying without luck to get it working. 
Cheers, and Merry Christmas!
Matthew

JD
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2021

Hi @Matthew Day 

Is there something common to all the log-rotation tickets (e.g. does it contain "log rotation" in the summary/description, is there a label etc...)? This will help the automation identify the correct tickets to target.

There are a number of trigger options you could use (e.g. issue create, schedule, field value changed).

And then you can add a branch to link it to multiple issues or just a simple issue link to link to a singular parent (e.g. Epic).

Thanks,

John

Matthew Day
Contributor
January 7, 2021

Hi John,

Very simply: labels = log-rotation
Most of my current (very limited) automation triggers off components added to tickets that trigger creation of sub-tasks. Very simple.

I'd like to apply any type of mechanism (labels, components, etc...) that then simply links related tickets (with the same mechanism identifier) without necessarily having them sit in epics that never end. 

i.e. if I have 350 servers, and 3 or 4 of them are problematic for log rotation, then applying a log-rotation label would then automatically link the tickets with 'relates to' within Jira. 

This way, when someone on support creates a ticket, it would automatically identify other open (or resolved) tickets with the same general identifier. 

JD
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2021

Ok @Matthew Day , I'm not sure if I've got it 100% but here is a starting point.

This automation runs every time the labels field is updated. There is a condition to check that the label is log-rotation. If it passes the condition then it searches for all the other issues with the same label and links each of them to the issue that triggered the automation. Below are some more details on each component in rule and also some thoughts on making it more specific:

Screen Shot 2021-01-08 at 4.22.27 pm.png

  • Use the field value changed trigger and monitor for labels to be changed
  • Using the issue field condition check if the label field contains the log-rotaion label. I've used contains any of as the operator because if you choose equals and there is more than one label assigned to the issue it won't pass the condition. 
  • Using a branch rule / related issues look for other issues that already have the log-rotation label assigned to them. I used a JQL for the type of related issue and just put labels = log-rotation for the JQL search.
  • In the branch add the link issue action and choose relate to and trigger issue.

A word of caution with this: As you use the label log-rotation more and more it will increase the number of tickets that are linked to your issue. So at some point you might end up with more than 100 related issues. Is there any other criteria you can add to the JQL search in the branch component to make sure only relevant issues are linked? Maybe by creation date or status?

  • created >= -52w will only link tickets that were created in the past 52w
  • status in ("TO DO", "In Progress") will only link issues that are open 

Let me know if that helps

- John

Like Matthew Day likes this
Matthew Day
Contributor
January 8, 2021

You've captured my intent perfectly. We've been in all-day SAFe I&A meetings, but I will test this out over the weekend. 

Suggest an answer

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

Atlassian Community Events