Find the next unreleased version

Abstract

This code snippet fetches the next unreleased version available for the current issue

Logic

Access the available versions for the issue and filter the next unreleased version by the version date

Snippet

def version
issue.getAvailableOptions("versions").each{
  if(!(it.isReleased()) && (version?.getReleaseDate() == null || version.getReleaseDate() >= it.getReleaseDate()))
  {
    version = it
  }
}
version?.getName()

Placeholders

N/A

Examples

The output of this code is a String representing the name of a Version which you could use in a Groovy expression, for example, to set a Version picker field in:

  • one of the Set Field Value post-functions
  • the Create issue post-function under Set fields of new issue section

References