Skip to main content
Example scripts
arrow icon
To homepage
Jira
Data centre icon
Data Center

Create a New Fix Version of the Selected Project

Created 1 year ago, Updated 1 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira (8.0 - 8.14)
compatibility bullet
ScriptRunner For Jira (6.18.0)
Language |
groovy
import com.atlassian.jira.component.ComponentAccessor

// the key of the project under which the version will get created
final String projectKey = "JRA"

// the name of the version - required
final String versionName = "1.0.1"

// the start date - optional
final Date startDate = null

// the release date - optional
final Date releaseDate = null

// a description for the new version - optional
final String description = null

// id of the version to schedule after the given version object - optional
final Long scheduleAfterVersion = null

// true if this is a released version
final boolean released = false

def project = ComponentAccessor.projectManager.getProjectObjByKey(projectKey)
assert project : "Could not find project with key $projectKey"

ComponentAccessor.versionManager.createVersion(versionName, startDate, releaseDate, description, project.id, scheduleAfterVersion, released)
Having an issue with this script?
Report it here