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 :
- Get all major versions :
{{#version.project.versions}}{{#released}}{{#name.startsWith("API V2 - 2.")}}{{name.substringBeforeLast(".").substringAfterLast("."))}},{{/}}{{/}}{{/}} - Get the biggest major version (to be able to compare with current version published) : varBiggestMajorVersion = {{varAllMajorVersion.split(",").max|0}}
- 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 :
- varPrefixWithMajorVersion = name.left(0).concat("API V2 - 2.").concat(varBiggestMajorVersion)
NB : it returns "API V2 - 2.23" as expected - 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