Create Release

Overview

Create a new release for a version using this script. The script records the date of release.

Example

I want to speed up and automate my release process. To reduce the time to manually create a version, I execute this script, specifying the version name, and project I wish to version. A version is then automatically created with the specified name, and release date.

Good to Know

  • There must not be more than one version with the same name in any specified project.

Requirements

Jira Jira

import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

final releaseDate = DateTimeFormatter.ISO_LOCAL_DATE.format(LocalDateTime.now())
final name = "Version $releaseDate"
final projectKey = 'TEST'
final archived = false
final released = true

post("/rest/api/3/version")
    .header('Content-Type', 'application/json')
    .body([
        name: name,
        archived: archived,
        released: released,
        releaseDate: releaseDate,
        project: projectKey
    ])
    .asString()
Discovered an issue? Report it here

Suggested for you