Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I create an automation rule that adds the label "Blocker" if it has any "Blocks" links

Daniel P_ Allis February 9, 2024

I'm trying to create (or have our DevOps folks create) an automation rule where if an issue has any "Blocked" linked issues that are not closed, it will add the label "Blocker" to that parent issue.

It seems straight forward (pseudo rule description):

When triggered

For Linked issues

If blocked by Trigger issue

Then Edit Trigger issue field (add label: "Blocker")

This seems like something someone that has been done before to support simplified filters, but I cannot find an example to share with our DevOps folks to speed this up. Anyone done this already?

1 answer

1 vote
Hariharan Iyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 9, 2024

Hi @Daniel P_ Allis 

 

You can create a rule as in the screenshot below

Screenshot 2024-02-09 at 7.47.42 PM.png

The trigger is "Issue Linked" with type "blocks". The issue that blocks the linked issue is considered the source issue here, so that's the one we need to edit. To add a label, select action as "Edit Issue". In fields to set, choose "Labels". Then click on the 3-dots menu and select ADDREMOVE, and in "Values to add", add "Blocker".

 

Hope that helps!

Daniel P_ Allis February 9, 2024

It seems like this would only work when using the "Blocks" link vs the "Blocked By". Will either link direction trigger this rule on the "Blocks" issue?

Hariharan Iyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 9, 2024

Either direction will trigger the rule. The points to note are:

1. The issue that "blocks" will always be the main issue

2. If you want to add a label on the issue that "is blocked" as well, you can use a branch as in the image below

Screenshot 2024-02-09 at 8.46.37 PM.png

And then in the next step in the branch, you can add a label (say, "isBlocked") to the issue that is blocked.

Daniel P_ Allis February 12, 2024

This is extremely helpful information. If you don't mind humoring me for one more question, here it goes. We have a lot of tickets already linked but not labeled. can I use a nightly time trigger and "For: Linked issues", "If: Link type (blocked)", set label to accomplish the same behavior to address existing issues? Sorry for the pseudoscripting. I'm asking to help support our internal DevOps folks on this issue. :)

Hariharan Iyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2024

Yes, a scheduled rule will work as well. However for finding all blockers, you would have to use JQL in the schedule. The JQL query to use would be 

project="your-project" AND issueLinkType=blocks AND resolution = Unresolved

One caveat with this is that it returns blockers as well as those issues that are blocked on the blockers, and there's no way to separate them in the JQL. So, if you want to put different labels on blockers and blockees(?), you will need two branches:

1. One will be the same as the one above (for blockees)

2. In the second one, the link type would "is blocked by" instead of "blocks" (for the blockers).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events