I like to set the Fix version of issues when they get the Done status to the next unreleased version by release date but not all the releases in the project should be considered.
I tried to iterate through all the releases, filter out archived, released and other releases by name that I don't want to be evaluated to find the next unreleased version. But a failed to continue from here. Any help would be very welcome.
First, I tried to build a JSON array with the following steps:
- Created a variable with the following value:
{{#project.versions}}
{{#not(archived)}}
{{#not(released)}}
{{#if(name.startsWith("Version "))}}
{{#if(exists(releaseDate))}}
{"name": {{name.asJsonString}}, "releaseDate": {{releaseDate.jiraDate.asJsonString}}},
{{/}}
{{/}}
{{/}}
{{/}}
{{/}} - Created another variable to make a JSON array:
[{{firstVariable.substringBeforeLast(",").split(",")}}] - Although, this seems to be a valid JSON array, like:
[{"name": "Version 2022.Q4", "releaseDate": "2022-12-31"}, {"name": "Version 2023.Q1", "releaseDate": "2023-03-31"}]
I cannot access to its content, the following try does not result in any value:{{secondVariable.releaseDate.min}}
Then, I tried to get the releaseDate of the release meeting the above-detailed criteria:
- Created a variable to list the releaseDates:
{{#project.versions}}
{{#not(archived)}}
{{#not(released)}}
{{#if(name.startsWith("Version "))}}
{{#if(exists(releaseDate))}}
{{releaseDate}},
{{/}}
{{/}}
{{/}}
{{/}}
{{/}} - Created another variable to have a real list of the values:
{{firstVariable.substringBeforeLast(",").split(",")}} - Although, this seems to be a valid list, like:
2022-12-30T00:00:00.0+0000, 2023-03-31T00:00:00.0+0000
I cannot select the earliest date, the following results in no value, so I cannot use it to filter for release name by the date:{{secondVariable.min}}