Hi,
working on data center automation I try to get Version which start and release date fit specific date.
As data center lack fixVersion iteration I searched and find similar case:
Solved: Jira Automation - Get the next unreleased version ... (atlassian.com)
and added condition to code:
{{#if (releaseDate.format("yyyyMMdd").isAfter(PDDdate))}}
but condition seems does not working, there are versions that are earlier and later than PDD so something should be returenr.
Do you have any ide how to make this working or other solution to get one proper version od Data center automation?
{{#issue.project.versions}}
{{#not(archived)}}
{{#not(released)}}
{{#name.startsWith("EIC 1.")}}
{{#exists(releaseDate)}}
{{#exists(startDate)}}
{{#if (releaseDate.format("yyyyMMdd").isAfter(PDDdate))}}
{{id}}-{{releaseDate.format("yyyyMMdd")}}
{{/}} {{/}} {{/}} {{/}} {{/}} {{/}} {{/}}
thanks
Michal
Hi @Michał
Short answer: This is not possible using rules with version date filtering for an iterator. If you explain how your variable PPDdate is defined, the community may offer other approaches, such as using JQL or calling the REST API to gather the versions for examination.
For more on why that type of filtering is not possible...
Once rule processing is inside of a smart value list iterator such as this:
{{#issue.project.versions}} ...inside the iterator... {{/}}
It cannot access any data which is not in the versions data. And so your created variable PPDdate is not visible and thus evaluates to null.
If you carefully read that thread you linked to in your question, you will see the workaround for this limitation:
{{varVersionData.split("~~").match(varRegExSearch)}}
However this will not help for your scenario as the match() cannot perform that type of date comparison.
Kind regards,
Bill
thank you @Bill Sheboy ,
PDDdate is variable that containing date taken from customfiled.
When I updated comparison from using variable to direct customfield call I got some version that has no releaseDate as well does not comply previous conditions.
{{#if (releaseDate.isAfter({{issue.customfield_21970}}))}}
So I assume:
1. customfield can be accessed in iterator
2. #if statment does not take previous conditions so I can't use one iterator to select correct version.
I believe I should follow rather Boldizsár Vermes solution. So moving step back.
I have a list of versions that meet few conditions.
How can I select one that has earliest 'releaseDate' after date in customfield_21970?
{{#issue.project.versions}}
{{#not(archived)}}
{{#not(released)}}
{{#name.startsWith("EIC 1.")}}
{{#exists(releaseDate)}}
{{#exists(startDate)}}
{{#if (releaseDate.isAfter({{issue.customfield_21970}}))}} //- this return one version
{{id}}-{{releaseDate}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I already described, the custom field is not "visible" inside of the iterator on versions. Only data from versions (and lower) is visible.
I do not believe a greater than date from a custom field search of version, release dates is possible with an Atlassian Automation rule with Jira Data Center.
If you know the exact release date to match, that can be found.
If the date you want is the maximum (or minimum) from the versions, that can be found. (This could be refined if rather than using {{issue.project.versions}} a call is made to the the REST API to gather the unreleased versions, in release date order.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.