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

This widget could not be displayed.

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


This widget could not be displayed.

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 Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

513 views 3 18
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