Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a smart value variable inside a for loop?

Andrew Bui
February 26, 2026

Hi all!

I am using JIRA Server and I'm having trouble using an existing smart value inside a for loop.

Example:

  • CORE-1 'is fixed by' FIX-1, FIX-2, and FIX-3
  • SEC-1 'is related to' FIX-1, FIX-2, and FIX-3

I have a jira automation (action) that does the following:

  1. Clones CORE-1 into CORE-1a
  2. Updates some metadata on CORE-1
  3. For each 'is fixed by by' FIX:
    1. clone FIX-1 into FIX-1a
      1. link FIX-1 as blocked by FIX-1a
    2. clone FIX-2 into FIX-2a
      1. link FIX-2 as blocked by FIX-2a
    3. clone FIX-3 into FIX-3a
      1. link FIX-3 as blocked by FIX-3a

What I'm not having trouble doing is setting SEC-1 'is related to' FIX-1a, FIX-2a, and FIX-3a.

 

In the jira automation, I set a smart variable successfully at the start such that {{secticket}} is set to 'SEC-1' by using a For JQL.

However, in the for loop 'For each 'is fixed by by' FIX:', I try to set FIX-1a, FIX-2A, and FIX-3a as 'related to' {{secticket}}, but {{secticket}} is EMPTY.

Is this a limitation, or am I doing something incorrectly? Is there a better way to accomplish this? 

 

2 answers

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 Champions.
February 26, 2026

Hi @Andrew Bui 

Automation branches which could be on more-than-one-thing run in parallel and asynchronously, and there is no guarantee of when the branch will complete...up until the last step of the entire rule.

https://confluence.atlassian.com/automation/branch-automation-rules-to-perform-actions-on-related-issues-993924648.html

 

For a rule which creates variables inside the branch, this means that each one is created independently, and thrown away as each pass through the branch / loop completes.

What does your created variable contain / represent?  Knowing that may help identify an alternative rule structure to find the value.

 

Kind regards,
Bill

0 votes
Matteo Vecchiato
Community Champion
February 26, 2026

Hi @Andrew Bui ,

Welcome to Atlassian community and thank you for your question.

To try to help, could you post your automation?

Kind regards

Andrew Bui
February 26, 2026

Screenshot 2026-02-26 at 10.56.14 AM.png


here's some redaction but the flow is the same! On that last step of link issue to {{secticket}}, it errors. I did confirm that {{secticket}} has the correct value after the variable is created at the top.

Matteo Vecchiato
Community Champion
February 26, 2026

I would suggest to create the variable with empty value before the "For Jql"

Suggest an answer

Log in or Sign up to answer