Example scripts
To homepage
Jira

Create a New Fix Version of the Selected Project
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira (8.0 - 8.14)

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