[Automation & Smart-value] Use smart value in function in lists selector

Rémi Lamotte May 23, 2023

Based on our version names (We have different version on the same Jira project called "API V1 - 1.22.125" and "API V2 - 2.22.236" and also "API V2 - 2.23.3"), i'm trying to create a new version when the latest major version has been published.

Example : Regarding the 3 versions above, when i'm publishing 2.23.3, I would try to create a 2.23.4 only if there is not already a version above manually created (2.23.12 for example).

 

Step by step automation : 

  1. Get all major versions : 
    {{#version.project.versions}}{{#released}}{{#name.startsWith("API V2 - 2.")}}{{name.substringBeforeLast(".").substringAfterLast("."))}},{{/}}{{/}}{{/}}
  2. Get the biggest major version (to be able to compare with current version published) : varBiggestMajorVersion =  {{varAllMajorVersion.split(",").max|0}}
  3. Filter all versions (which has the biggest major version) to get only minor versions : 
    {{#version.project.versions}}{{#released}}{{#name.startsWith(name.left(0).concat("API V2 - 2.").concat(varBiggestMajorVersion))}}{{name.substringBeforeLast(".").substringAfterLast("."))}},{{/}}{{/}}{{/}}

The bold part above is not working. I also tried to put it in a var and then use it : 

  1. varPrefixWithMajorVersion = name.left(0).concat("API V2 - 2.").concat(varBiggestMajorVersion)
    NB : it returns "API V2 - 2.23" as expected
  2. varAllVersionsWithMajorVersion :
    {{#version.project.versions}}{{#released}}{{#name.startsWith(varPrefixWithMajorVersion)}}{{name.substringBeforeLast(".").substringAfterLast("."))}},{{/}}{{/}}{{/}}

It still doesn't work.

My question is : Is it possible to use smartValue in function inside listSelector : 
{{#name.startsWith(smartValue)}}

Thanks


 

0 answers

Suggest an answer

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

Atlassian Community Events