Creating automation rules for specific Jira tickets

Luke January 12, 2023

Hi, I'm trying to create an automatic rule that does the following, but cannot figure it out: 

1/ For selected issues only (e.g. issue numbers, let's say, T01-T12 or whatever)

2/ When another issue (or issues) is linked (via any link type) to any of said selected issues

3/ Then notify a specific user (potentially other actions too, but this is fine for now!)

How do I go about it? Is it perhaps better to flag/tag/categorise those specific tickets somehow first, or maybe preassign them to a user (worried user will get changed, though!) or via some other method? I can't work out the right steps to get selected issues/tickets. 

These issues that I need to action will never (or rarely) be closed as each represents a component type within our software suite. I want to alert the lead dev for each component whenever an issue (e.g. bug, feature request) is linked to it. 

Thank you. 

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2023

Hello @Luke 

Welcome to the Atlassian community!

Are the tickets being linked together all in the same project, or potentially in different projects?

Is this for a Company Managed project or a Team Managed project?

Luke January 12, 2023

First off, thank you for such a fast response to my first ever community question and the kind welcome! :) 

Right so, the tickets/issues representing web components are all sitting under one project (let's call it 'Base'). However, issues being linked to the issues in Base will be mostly from other projects (idea in a nutshell is other live projects are reporting issues/bugs/enhancements on their custom implementations of Base code, so some will get fixed in the Base then rolled back out for all projects). 

Base is a Company Managed project (all projects should be, in fact). 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2023

There is an Automation Rule Trigger for "Issue Linked" when an issue link is created.

https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Issue-linked

However, it is a tricky rule to master.

Rule executes when an issue is linked to another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B. To access ISSUE-A, use {{destinationIssue}}, and to access the link type, use {{linkType}} (e.g. {{linkType}}

It depends on what is considered the "source" issue and the "destination" issue. This is determined by the link relationship. From the Issue Linking page where Link types are defined...

Screen Shot 2023-01-12 at 1.00.46 PM.png

The issue that shows the "Outward Description" in its Linked Issues section is the one that "triggers" the rule.

Your rule would have to be set to run against each project where an issue in that project might get linked to an issue in the Base project, and where that issue would have the Outward Descriptions side of the link relationship.

After detecting that, you would need to determine if the link was to one of the issues that you are concerned about. I haven't quite worked out how to do that.

I can keep looking into the solution, but it will be a lower priority task for me. It may take me some days to figure it out completely.

Luke January 16, 2023

Hi Trudy, thanks so much. I'll try to figure out out from the puzzle pieces you've kindly given me thus far. If I get stuck maybe I can pop back and holler! Really appreciate your time and help. 

Moheeb Qupty May 15, 2024

Hi @Trudy Claspill ,

You mentioned: "The issue that shows the "Outward Description" in its Linked Issues section is the one that "triggers" the rule." 

What do you mean by that? where is that "Linked Issues" section that have "Outward Description"?

I have problem to figure out the directional of a link type whether it's "inward" or "outward" in order to know to use "{{issue}}" or "{{destinationissue}}".

Of course we know from experience to distinguish by "block" or "is blocked by"... etc. But should be some machoism to distinguish between the two by code. Is {{LinkType}} has property to indicate that?

Best Regards,

Moheeb. 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2024

"Linked Issues": I am referring to the section that displays when you are viewing an individual issue, shown below within the red box. The arrow is pointing to the Inward Description or the Outward Description for the link type used to link issue CRS-3 with CRS-2.

Screenshot 2024-05-15 at 6.00.55 PM.png

 

To determine if that is the Inward Description or the Outward Description you would need to look at the Issue Link Types that have been defined for your instance. A Jira Administrator can access that information at

https://<your Base URL>/secure/admin/ViewLinkTypes!default.jspa

Here is a partial screen image from my instance.

Screenshot 2024-05-15 at 6.05.32 PM.png

I said "The issue that shows the "Outward Description" in its Linked Issues section is the one that "triggers" the rule." 

In the example above, viewing CRS-3 we see the description in the Linked Issue section is "is blocked by". When we look at the Issue Link Types screen we see that "is blocked by" is in the Inward Description column for the Blocks link type.

If we looked at the linked issue, CRS-2, in its Linked Issue section we would see that it displays "blocks", which is in the Outward Description column.

Screenshot 2024-05-15 at 6.09.07 PM.png

In this case a rule triggered by the creation of this blocks/is-blocked-by link would be triggered by CRS-2, even if the creation of the link was initiated from CRS-3.

 

The smart value {{linkType}} will give you only the Name of the link type that was used; i.e. Cloners or Defect, from the same screen image above. I don't see any way yet to use that smart value to obtain the Inward or Outward Descriptions associated with the link type.

Like Luke likes this
Moheeb Qupty May 15, 2024

Yes, me too couldn't a find a way using smartvalues to obtain such information whether the direction is inward or outward, only as you said if the Admin goes to the Issue Types and check that manually.

The main problem we can't determine when to use {{issue}} or {{destinationissue}} in the rule since still can't know the rule was triggered by using inward or outward link as it can be triggered not from the issue/screen we acted from!

So the trigger for "create link" or "delete link" has a big disadvantage when we don't know which link type and/or which issue the rule will initiated from.

The way they did it isn't beneficial, and can causes data problems and mistakes and not simply the rule can't run; I would accept if there's a way to prevent the rule from triggering if the link type we are add/deleting is "inward" but no such a thing as we can't identify that.

I think Atlassian need to think it over and change the mechanism, why not just trigger the rule from the issue the user acted upon and define the real current link (e.g. {{LinkType}}="is duplicated by" vs. {{LinkType}}="duplicates").

Best Regards,

Moheeb.

Like Luke likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2024

It sounds like what you want is a rule that will act against the issue from which you created the link, regardless of which part of the link relationship that issue gets. For example:

If you are in issue A and you create a link that issue A blocks issue B, the rule should act against issue A, because that is where you created the link.

And if you are in issue A and you create a link that issue A is blocked by issue C you still want the rule to act against issue A, because that is where you created the link.

Is that correct?

That is in contrast to the how such a rule currently works where it defaults to working against the issue that is on the Outward Description side of the link, regardless of the issue where the link is created.

If I have correctly understood, I suggest you provide your suggestions directly to Atlassian through a support case or using the Feedback option available directly within Jira.

Suggest an answer

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

Atlassian Community Events