Hi,
A beginner - question regarding the script runner.
The code below correctly returns the version with the highest ID (the last created version).
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
def versionManager = ComponentAccessor.getVersionManager()
def versions = versionManager.getVersions(issueContext.projectObject)
if (versions)
{
getFieldById(AFFECTED_VERSIONS).setFormValue([versions.last().id])
}
How to properly enhance this script to show the last created version, but only taking versions that start with / that have, e.g. "RC_*" in their name?
I'm hoping for your help after many hours invested in learning and testing methods proposed for slightly different cases - which unfortunately returned () for me.
Thanks a lot!