---
title: "Find the next unreleased version"
canonical: "https://support.appfire.com/space/JMWEC/466257252/Find%20the%20next%20unreleased%20version"
format: markdown
---
> Macro (aura-html)

### Abstract

<span style="color: #333333">This code snippet fetches the next unreleased version available for the current issue</span>

### Logic

<span style="color: #333333">Access the available versions for the issue and filter the next unreleased version by the version date</span>

### Snippet

```javascript
{% set vers = {} %}
{% for v in issue | projectInfo | field("versions") %}
  {% if not v.released and (not vers.releaseDate or vers.releaseDate >= v.releaseDate) %}
    {% set vers = v %}
  {% endif %}
{% endfor %}
{{vers.name}}
```

### Placeholders

N/A

Examples

<span style="color: #333333">The output of this code is a String representing a Version which you could use in a template, for example, to set a Version picker field in:</span>

- <span style="color: #333333">one of the Set Field Value post-functions</span>
- 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

- [Using Nunjucks Templates](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465503811)
- [projectInfo filter](/wiki/spaces/MWECS/pages/78482118)
- [field filter](/wiki/spaces/MWECS/pages/78482118)

### Related articles

> Macro (contentbylabel)