Error when creating automation between two dependent tickets

Pedro April 29, 2024

Hi all,

Recently I had a request to create an automated rule when any issues are transitioned to "Done" status, to check against any open dependencies, and if there are any dependencies "In Progress", to reopen the original ticket until all dependencies are marked as "Done".

The problem I'm facing is that Jira reads the dependency relationship as bidirectional, keeping both Issue 1 and Issue 2 perpetually in "In Progress", creating a loop. It both reads Issue 1 as dependent on Issue 2 and Issue 2 dependent on Issue 1.

Is there a particular way to solve this issue if you have faced it before? A partial fix is to use the hierarchy status for subtasks, but in this case, Stories can be dependent on other Stories so the hierarchy wouldn't always apply.

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.
April 29, 2024

Hello @Pedro 

Whenever asking for help with an Automation rule, providing screen images showing your full automation rule and details of each step will enable us to help you faster. It is also helpful if you provide the information that gets written into the rule's Audit Log when the rule executes.

And in this case can you show us screen images of one pair of issues where one issue is dependent on the other? For this what I'm looking for is to see the Issue Links section that shows the name of the link relationship (i.e. depends on / is depended on by).

Pedro April 29, 2024

Hi Trudy,

Thanks for your comments. In this case I wasn't able to provide a screenshot as this is happening under my work account rather than my personal account, as atlassian community was blocked by our enterprise. This is why I extensively described the issue. I will try and grab a screenshot tomorrow.

When an issue transitions to Done

If there are dependency relationships open

Then transition the issue back to In progress 

and then edit comments.

The issue I see is that the automation thinks of both tickets, 1 and 2 as the same. If I try and close issue 1, it reopens, if I try and close issue 2 it also reopens it, therefore creating an infinite loop.

Is there a known way to have a ticket not be able to be closed, via automation, in case it has an open dependency relationship?

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.
April 29, 2024

The solution depends on two things:

1. The way you link dependent issues.

2. The way, in the rule, you are looking for dependent issues.

When you set an issue as dependent on another issue, I assume you are using the issue linking functionality. 

An issue link has a name, and Inward Description, and an Outward Description.

If you look at the issue that has been transitioned to Done, and you look in the Issue Links section, you should see a Description header above the dependent issues, for example "is depended on by" or "blocks".

If you open one of those depended issues and look at its Issue Links section you should likewise see a Description header above a list that includes the issue that you changed to Done. The header may be something like "depends on" or "is blocked by".

If the same Description appears in both the primary and secondary issues' Issue Links section, that could be the cause of the problem.

If the Description is the same as the Name of the link type, that could be the cause of the problem.

To find dependent issues in your rule you might be using a Lookup Issues action with a JQL that includes the linkedIssues() function:

https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedIssues--

...such as

issue in linkedIssues("{{triggerIssue.key}}","is depended on by") and statusCategory !=Done

The linkedIssues function should find the issues linked to the trigger issue with the specified link relationship.

You can then check if the Lookup Issues action found more than 0 issues. If it did, then you transition the trigger issue back to In Progress.

Screenshot 2024-04-29 at 9.43.20 AM.png

If you have not tried a rule structured like that, please consider trying that and see if it resolves your issue.

 

Like Bill Sheboy likes this
Pedro April 30, 2024

Hi Tracy,

 

So the root cause of the issue was that in our project we had a relationship status called "Depends". This would be read the same in both ticket 1 and 2, therefore causing the automation rule to not be able to differentiate between them. The fix was to use a different relationship type "is depended on by", which differs from ticket 1 and 2, where ticket 2 reads "Depends on".

 

I was therefore able to create a simple rule stating that "If some linked issues match "Types: is depended on byMatch: Project = X and status not in "done"" Then transition the issue to In Progress" And: add comment to issue "Hi, please verify all dependencies are closed before closing this ticket as there are still open tickets with a dependency relationship."

 

Thank you for your help on this!

Suggest an answer

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

Atlassian Community Events