Dear members.
I am trying to create an automation for generating email alerts for the features with all child issues as Abandoned/Done/Accepted.
I have created a Variable - variableOutSideBranch at top of the rule with smart value as INIT. I am then creating a Branch to iterate over each features for child checks and appending such into another same variable as variableOutSideBranch witn smart value as {{variableOutSideBranch}}{{featureRows}}. I could see Features are appending inside the branch.
However when I call the same variable outside the branch to perform actions, it does not the the same value as what it had inside the branch and reset to one at top of the rule. This breaks the automation as this does not have features detail I obtained inside the branch and appended to same variable.
Please note I am not using any third party addins/Apps and sticking to pure Jira Cloud native automation resources.
Can someone guide me rectifying this issue?
Hello @PANKAJ MISHRA
What you’re seeing is expected in Jira Cloud Automation.
When you go into a branch (“for each issue…”), Automation is basically running in a separate context. So even if you “append” to a rule variable inside the branch and you can see it growing there, that change doesn’t reliably carry back out to the main rule once the branch finishes. Outside the branch the variable will still look like whatever you initialized it with (your INIT).
So the fix isn’t “tweak the smart value” it’s using a different pattern.
What works well in native Automation:
Don’t build a big string variable across a branch.
Instead, collect the issues you care about (e.g., with Lookup issues) and then build the email content at the end using a loop like:
{{#lookupIssues}}
- {{key}}: {{summary}}
{{/}}
If you truly need an “accumulator”, use something that persists, like an issue entity property (store the running text there during the branch, then read it once at the end). That’s the closest “append” behavior you can get without an app.
If you post a screenshot or list of your rule steps (especially how you’re checking “all child issues are Abandoned/Done/Accepted”), it’s easy to suggest the cleanest native rule structure for a single consolidated email.
Hope it helps 👍
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
Branches in automation rules run in parallel and asynchronously, with no guarantee of when the branch will finish up until the last step of the rule. (The exception is branches over one-and-only-one thing, such as branch to parent.)
What this means for the rule you describe is the created variable repeatedly gets created and thrown away with each pass through the branching loop. And so, no accumulation is possible.
A workaround for your scenario is using the Lookup Work Items action, inverting the JQL condition to find the children, and then extracting the parent work items meeting your criteria. Finally, use a second lookup with JQL to gather any details needed about the "features" for the email.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.