In Jira Automation, how can I do a branch, and then come back to the main path?

Cash Coyne
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.
April 20, 2023

I have an automation rule that looks like this:

Jira Branch Automation Question.jpg

The value for the Smart Value Variables comes from this smart value: {{lookupIssues.Story Points.sum|0}}

The Next thing I want to do is send a single email with both the ToDoStoryPoints andInProgressStoryPoints, but when I have the email action on the leftmost path, the smart value variables are empty as they haven't been calculated (or aren't available on that path?).  

Is it possible to have the For JQL branch processed, wait til it's done so the variables have the data, then go back and continue with the next branch, and then go back and send the email on the leftmost path? (like on the red arrows in the screenshot)

Or some other way to have those values available to put in a single email once everything is calculated?

TIA!

 

1 answer

1 accepted

4 votes
Answer accepted
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.
April 20, 2023

Hi @Cash Coyne 

No, that is not possible yet, and it may not be necessary for your scenario.

First thing, branches on one-and-only-one issue (e.g., branch on parent) get run in-line, as if there was no branch.  Branches which could be on multiple issues/things (e.g., JQL, linked issues, etc.) are run asynchronously and in parallel.  There is no guarantee when the branch will end or the order of processing...right up to the last step in the rule.  https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Ordering-of-branch-executions

I recall there is a suggestion to add an option to pause process until a branch ends, like for web requests.

Next, because of the multi-issue branch, creating a variable in the branch means it will not be visible outside of the branch...it will be repeatedly recreated from scratch and thrown away with each loop.

Back to your scenario...it seems you want to query and then count some issues, based on some criteria.  You could use Lookup Issues by itself to get the counts by just supplying the JQL for the query, and then store that in the created variable for later use.

Kind regards,
Bill

Cash Coyne
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.
April 20, 2023

Not sure I follow on your alternate method.

I have two different queries which will return two completely different sets of issues. I don't see how I can create a variable from a JQL search in a single component.  And if I do the first search, create the first variable, then do the second search, wouldn't that only search the set of issues which is the first search which will contain none of the issues that I want for the second search?

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.
April 20, 2023

You cannot, but you can use the Lookup Issues action as many times as you want.  Such as:

  • action: lookup issues with JQL to find issues in set 1
  • action: create variable to save your count
  • action: lookup issues with JQL to find issues in set 2
  • action: create variable to save another count
  • etc.

You could also use math operations and smart value, list filtering to count on a single result set.  An example of this is to count issues with different status values...but everything else is the same.

Like # people like this
Cash Coyne
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.
April 24, 2023

Yes @Bill Sheboy , this worked.  Thank you!

Between you and @Trudy Claspill I have been successfully educated on the lookup issues action!

Like # people like this
Jaime Capitel _resolution_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 12, 2023

@Bill Sheboy That's a great to know @Bill Sheboy I always feel a bit left in the dark with Automation, especially when it comes to troubleshooting. Are there any great resources out there?

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.
June 12, 2023

Hi @Jaime Capitel _resolution_ 

I have not found any great resources, only ones improving over time.  :^)  My recommendations would be:

Kind regards,
Bill

Jaime Capitel _resolution_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 12, 2023

Tons of value there @Bill Sheboy , thank you!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events