JIRA Groovy validator to fire if fixRelease is unreleased

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

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()


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
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page

                                                      &nbsp...

246 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you