How do you retrieve all the releases through the API that are shown on the "Releases" page in Jira cloud?
e.g.
The Python API has has a `version(id)` function, but it requires an ID. I need to lookup all the releases that have been created, just just a specific one.
In this case, I think you are looking for a specific version name/number, namely the unreleased ones in that project. As such you can retrieve this by using the endpoint of GET /rest/api/3/project/{projectIdOrKey}/version More details on the syntax of this can be found in Get project versions paginated.
This endpoint will allow you to use the status parameter in your REST call, which you can enter the value of 'unreleased' in order to see all those versions in that project that have not yet been released.
I ended up using the Python wrapper for the API and doing:
jira = JIRA({'server': server_name}, basic_auth=(username, password))
versions = jira.project_versions(myproject_key)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thought I would update this with how I am doing it using the Jira wrapper:
from jira import JIRA
from jira.client import ResultList
from jira.resources import Issue
rootURL = "https://xxxxxxxxxx.atlassian.net"
##############################################
# functions
##############################################
def getReleases(jira):
dictVersions = jira.project_versions("KME")
for thisVersion in dictVersions:
print(dir(thisVersion))
break
##############################################
# app starts here
##############################################
#jira setup
print(f"Getting Jira authentication...")
jiraOptions = {'server': "https://xxxxxxx.atlassian.net"}
jira = JIRA(options=jiraOptions,
basic_auth=(YOUR-USERNAME, YOUR-API-TOKEN), # Jira Cloud: a username/token tuple
)
getReleases(jira)
For each instance of the Version class you can access this data:
'archived', 'delete', 'find', 'id', 'name', 'projectId', 'raw', 'releaseDate', 'released', 'self', 'update', 'userReleaseDate'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.