Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Abstract

This code snippet finds the earliest unreleased version scheduled after a certain date

Logic

Access the available versions for the issue and find the earliest unreleased version scheduled after a certain date

Snippet

Code Block
languagejs
linenumberstrue
{% set vers = {} %}
{% for v in issue | projectInfo | field("versions") %}
  {% if not v.released and v.releaseDate >= <Specific date> and (vers.releaseDate == null or vers.releaseDate > v.releaseDate) %}
    {% set vers = v %}
  {% endif %}
{% endfor %}
{{vers.name}}

Placeholders

PlaceholderDescriptionExample
<Specific date>
Access the field of type Dateissue.fields.duedate

Examples

The output of this snippet is a String representing the name of a Version which you can use in a template, for example, to set the Fix Version/s of an issue to the earliest unreleased version scheduled after the Due date in:

  • one of the Set Field Value post-functions
  • one of the Transition issue post-functions on the transition screen, if any
  • the Create issue post-function under Set fields of new issue section

References

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "jmwe-nunjucks" and type = "page" and space = "KB"
labelsjmwe-nunjucks jmwe-cloud

...