Forums

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

Jira automation - using variable in another variables smart value

Anna Mjau
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

In my Jira automation, I have created a variable:
varReleaseVersion, which has a value 28.5

Then Im creating another variable:
FilteredReleaseVersions, with a value 
{{#project.versions}}{{#name.startsWith(varReleaseVersion)}}{{name}},{{/}}{{/project.versions}}

 

With this definition FilteredReleaseVersions does not return anything.

logfiltered1.png

When I change
FilteredReleaseVersions, with a value 
{{#project.versions}}{{#name.startsWith("28.5")}}{{name}},{{/}}{{/project.versions}}

Then it returns correct results:
logfiltered2.png

I have tried also 
FilteredReleaseVersions, with a value 
{{#project.versions}}{{#name.startsWith({{varReleaseVersion}})}}{{name}},{{/}}{{/project.versions}}

but then I get an error: 

Error rendering smart-values when executing this rule:
Parameters not closed: ({{varReleaseVersion: {{#project.versions}}{{#name.startsWith({{varReleaseVersion}})}}{{name}},{{/}}{{/project.versions}}

Question - how should I correctly use the varReleaseVersion variable in the other smart value variable? 



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 Leaders.
September 16, 2025

Hi @Anna Mjau -- Welcome to the Atlassian Community!

You are observing a long-standing limitation for rules, preventing filtering of the list because the first variable is not visible:

Once inside of a long-format iterator, only data from the iterator scope, and lower, is accessible.

 

For your scenario, you seem to only want the version name attribute.  Thus, a workaround is to use a dynamic regular expression and the inline-format for iteration.

  • ...
  • create variable
    • name: varRegEx
    • smart value: ^({{varReleaseVersion}}.*)$
  • get the matching version name
    • {{project.versions.name.match(varRegEx)}}

This will produce a list of values.  If you are only expecting one (or no) results, please add the first function to the end.

 

When you need more attributes than just the name, an advanced version of this technique is required.  To learn more about that, please read this article I wrote on it: Dynamic searches within a list.

 

Kind regards,
Bill

0 votes
Michael Wohlgemuth
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.
September 16, 2025

Heyo!

Assuming the variable is not empty where you try to access it (please check - it might be if it gets filled in a branch): You could try converting whatever type the variable has to string and see if that changes anything (low chances but perhaps worth a try): 

{{varReleaseVersion.asJsonString}}

Anna Mjau
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

That unfortunately did not work. It threw the same error:

Error rendering smart-values when executing this rule:
Parameters not closed: ({{varReleaseVersion.asJsonString: {{#project.versions}}{{#name.startsWith({{varReleaseVersion.asJsonString}})}}{{name}},{{/}}{{/project.versions}}

Regarding varReleaseVersion having value - it definitely has the value, because it is set right before the failing variable. And in later logs {{varReleaseVersion}} has the value. It just does not seem to work inside the .startsWith of the other smart value.

Suggest an answer

Log in or Sign up to answer