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

robotsnoindex

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

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.

Environment

The race condition can occur on any version of Jira and the Automation plugin.

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.

automation-rule-executor:thread-2 WARN [c.o.scriptrunner.runner.ScriptBindingsManager] Setting the label for the issue : [LabelValue1]

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

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.


Last modified on Jan 29, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.