Forums

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

how to set list of values to smart variable

Katherine Chan December 22, 2023

I would like to set a list of values for a smart variable and loop through in my automation.  I found documentation of setting list of values to smart variable from list values of a field or from a jql.  But is there a way to just define a list of values to a smart variable? 

1 answer

1 accepted

3 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.
December 22, 2023

Hi @Katherine Chan 

To confirm my understanding of your terminology, what do you mean by "smart variable" and a "list of values"?

 

Automation rules use smart values to access issue fields and other data available to the rules.  For example, here are the ones for issue fields: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

Some of those smart values could be lists, where the individual elements can be accessed.  For example, the Fix Versions field.  Here is more information on list handling in rules: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/

Rules also have an action to Create a Variable, for use in a rule for temporary data storage: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable

And finally, rules have branches, which allow looping over various things, such as issues, lists, and even created variables: https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/

 

Putting those things together, I believe you are asking about setting a created variable and then using that to branch over the items.  If so, that could be like this:

  • action: create variable
    • variable name: varMyVariable
    • smart value: apple,banana,orange
  • advanced branch:
    • smart value: {{varMyVariable.split(",")}}
    • variable name: varFruit
      • action: do something using {{varFruit}}

 

Kind regards,
Bill

Katherine Chan December 22, 2023

Thank you!  Yes, that's what I'm looking for!  

Like # people like this

Suggest an answer

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

Atlassian Community Events