Abstract
This code snippet sets a Versions field of an issue to finds the earliest unreleased version scheduled after a certain date
Logic
Fetch Access the unreleased available versions of the Project for the issue belongs to and iterate over them to find and finds the earliest unreleased version scheduled after a certain date
Snippet
Code Block | ||||
---|---|---|---|---|
| ||||
def version issue.getAvailableOptions("versions").each{ if(!(it.isReleased()) && it.getReleaseDate() >= issue.get("<Date field name>"<Specific date>") && (version?.getReleaseDate() == null || version.getReleaseDate() >= it.getReleaseDate())) { version = it } } version?.getName() |
Placeholders
Placeholder | Description | Example |
---|---|---|
<Date field name> | Name of the field of type Date | duedate |
Examples
The output of this snippet is a String representing the name of a Version which you can use in a Groovy expression, 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
the Create issue post-function under Set fields of new issue section
References
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...