Asynchronous execution in automation rule?

Yurii Serebriakov November 13, 2024

Hello,

We have an automation rule as follows: at the very beginning, a variable (createdIssueKey) is created and assigned the value 0 (screenshot 1). Next, if the issue meets one of the conditions of the if/else component, a new issue is created (screenshot 2) in another project. When created, all attachments from the current issue are copied over. The key of the newly created issue is recorded in the createdIssueKey variable (screenshot 3).

Then, using the “Branch rule / Related issues” component, a JQL search is performed using the key of the issue created above.

Here’s what I’ve noticed. If the volume of attachments in the current issue is relatively large (I tested it with approximately 80 MB), the “Branch rule / Related issues” component executes without waiting for the “Create issue” action to complete, and consequently, the rule fails with an error.

Are the issue creation actions performed asynchronously?

1.png2.png3.png4.png

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2024

Hi @Yurii Serebriakov -- Welcome to the Atlassian Community!

For a question like this, please post an image showing the audit log details for the rule execution.  That will provide context to determine what happened when the rule ran.

Also, I recommend posting the complete rule in a single image, perhaps using a capture tool or browser addon for scrolling-page capture.  This will ensure nothing is misunderstood / misplaced in the rule images shown.

 

Back to your questions...

I believe for the rule you show the actions before the branch execute synchronously, one after another.  And issue creation happens prior to adding attachments in Jira, thus it is likely the automation engine uses multiple REST API calls, with the second one processing asynchronously.  (The same is the case for linking, transition, etc. during issue create.)  Only contacting the support team to ask the engineers will likely confirm this behavior: https://support.atlassian.com/contact/#/

 

However after that point in your rule, branches which could be on more-than-one-thing are executed in parallel and asynchronously, with no guarantee of processing order or when they will complete, up until the last step of the rule.

Seeing the details of your audit log (and the error) will help to clarify what is happening.

And I wonder: why are you updating the created issue's Attachments in the branch?  If the attachment adding in the rule engine is a separate REST API call, I hypothesize your edit could collide with that, leading to unexpected behavior and errors.

 

Kind regards,
Bill

Yurii Serebriakov November 13, 2024

Also, I recommend posting the complete rule in a single image, perhaps using a capture tool or browser addon for scrolling-page capture.  This will ensure nothing is misunderstood / misplaced in the rule images shown.

Here is a screenshot from the audit log with a rule error. I couldn’t capture the entire log, but the most important part is at the very bottom.

chrome_ufEIgmixCy.png

 

And I wonder: why are you updating the created issue's Attachments in the branch?

Attachments in my rule are copied in the issue creation action. Therefore, I assumed that the action is performed asynchronously, and execution moved to the Branch rule without waiting for the issue to be created. Consequently, since the created issue key was not recorded in the variable *createdIssueKey*, the Branch rule returned an error.

chrome_XjpcSgfbHB.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2024

Ah, your rule is acting on multiple projects...What is the scope of the rule: single-project, multiple-project, or global?

A single-project scope rule may create / clone issues in other projects, but it cannot access them otherwise.  When that is attempted the permission error you see can appear.

To fix that symptom, the rule scope must be multiple-project or global in scope.  Your Jira Site Admin will need to help with that as the setting is changed from the global automation area.

Yurii Serebriakov November 15, 2024

The scope is multiple projects. The issue is not caused by the Scope. If the volume of Attachments is small the rule completes successfully.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2024

In that case, I recommend working with your Jira Site Admin to submit a ticket to Atlassian Support to take a look: https://support.atlassian.com/contact/#/

Once you hear back from them, post what you learn to benefit the community.

Like Yurii Serebriakov likes this

Suggest an answer

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

Atlassian Community Events