I tried one the solution shared in this forum to update the fixversion, but having issues.
In the below code, user updating the issue with all unreleased version.
But, How can we updated the issue with a specific unreleased version? I would like to pass the version value through some variable. Really appreciate any help.
import com.atlassian.jira.component.ComponentAccessor
def versionManager = ComponentAccessor.getVersionManager()
def project = issue.getProjectObject()
def version = versionManager.getVersionsUnreleased(project.getId(), true)
if (version) {
issue.setFixVersions(version)
log.info("${issue.key} - fix version/s has been updated with ${version}")
}
else{
log.warn("Version does not available")
}