Automation for Jira rules don't trigger due to race condition

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The automation rules fail to trigger due to race conditions that come from other automation.

Diagnosis

First, troubleshoot the issue by following the diagnosis mentioned here: Automation for Jira - Troubleshooting situations where automation rules are not triggered Post-checking the KB article mentioned above if the issue persists, you can check the following points:

  • To validate the race condition, trigger the rule by doing manual changes to the element that is associated with the rule.

  • From the browser, under the Developer Tools check the Network tab to see if there are any third-party apps that read the same element.

Cause

The issue is caused due to the race condition when a third-party plugin or any other automation checks the same element that the A4J rule is checking. During this, the automation rule will not trigger. For example: Take a look at the following log snippet. You could see that the Scriptrunner is also involved in setting the label, where the trigger was answered by Scriptrunner. Trigger is a single event where only 1 listener can take it up, in this case, Scriptrunner raced over A4J.

1 http-nio-8080-exec-976 url: /browse/ABC-1234, /secure/IssueNavAction!default.jspa; user: test WARN test 500x16715656x8 test12 /browse/ABC-12340 [c.o.scriptrunner.runner.ScriptBindingsManager]

Further, the Scriptrunner was still running some code on the same issue:

1 http-nio-8080-exec-976 url: /browse/ABC-1234, /secure/IssueNavAction!default.jspa; user: test WARN test 500x16715656x8 test12 /browse/ABC-12340 [c.o.scriptrunner.runner.ScriptBindingsManager]

Such a race condition with Scriptrunner and Automation for Jira will not trigger the rule and the audit log will not have any details about the rule.

Solution

Rules are triggered when an event is fired by the Jira application. Make sure other applications don't capture this event.

  • Avoid creating more than 1 automation for the same element

  • Try rewriting the rule such that the rule accommodates the logic of other apps as well.

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.