JIRA Groovy validator to fire if fixRelease is unreleased

Robert G. Nadon
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.
November 18, 2016

Hi all,

I need to fire a validator if the Fix Version/s is unreleased, and therefore does not have a releaseDate.  I prefer to check if it is released or not but all released versions have release dates and vise-versa.

We enforce that there is only one fix version for each issue, if the issue gets resolved in another version then another issue is used.

I have tried the following, none of which work:

  • issue.fixVersions*.isReleased()
  • issue.fixVersions*.releaseDate
  •  srcVersion.releaseDate
  • srcVersion.isReleased()
  • issue.srcVersion.isReleased()
  • issue.fixVersions*.getReleaseDate()

Any thoughts on how to setup a simple validator ito fire if the fix Versions is unreleased?

Thanks!

Robert

2 answers

1 accepted

1 vote
Answer accepted
Robert G. Nadon
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.
November 18, 2016

Thank you @Vijay Khacharia!  this post Validator to make sure fix version >= affects version on resolving issue solved my problem!

Here is the condition to fire the validator for unreleased versions.

issue.getFixVersions().iterator().next().getReleaseDate()


1 vote
Ivan Pushechnikov October 19, 2017

Thank you @Vijay Khacharia! You helped me too.
And I found more expretions to solve some related problems:

  • issue.getFixVersions().get(0).getReleaseDate()
  • (issue.getFixVersions() == null)
  • issue.getFixVersions().iterator().next().isReleased()

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events