I can't figure out a proper for-each loop that will both run automation for the trigger issues, and each of the destination issues that are linked so every related issue is consistently linked to each other.
Scenario: account1, account2, and account3 all related to each other via a parent account number and need to be linked. So far, I only have been able to create automation that links account1 to account 2 and account3 using a for-each loop to see all issues in a project that have the same parent account number and link it to the trigger issue when the parent account number is populated in a newly created issue.
My current automation's output:
account1 relates to account2 & account3
account2 relates to account1 (missing link to account3)
account3 relates to account1 (missing link to account2)
How do I use Jira automation to solve for the missing links in account2 & account3? A secondary automation that triggers when the trigger issue becomes linked?
Below is the current automation:

Thanks!