Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Change status to released

tony cameraman August 27, 2018

I have a Board named ASDF, In that board under Relaeses tab I have a Version named: QWER. This version has 3 issues.

I want to change the status of the version to "Released" if all the issues are in "done" state. I don't know how to change the status to "Released".

I am trying to do this using JIRA-Python REST-API. I am also open to CLI method. 

3 answers

1 accepted

1 vote
Answer accepted
Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2018

@tony cameraman 

 

To update release status you can use the following Rest API with PUT method. 

PUT http://{PutYourDomainHere}:Port/jira/rest/api/2/version/{id}

Body Example

{
"self": "http://{PutYourDomainHere}:Port/jira/rest/api/2/version/10000",
"id": "10000",
"description": "An excellent version",
"name": "New Version 1",
"archived": false,
"released": true,
"releaseDate": "2010-07-06",
"userReleaseDate": "06/Jul/10",
"projectId": 10000
}

 

So, if you are going to use JIRA-Python-API: 

You'll need to create a function "release_version" to update release it will be similar to "create_version" with add "id" and change the Rest method to be PUT instead of Post

 

So, to achieve your scenario:

 

You will use "version_count_unresolved_issues(id)" to get to the list of unresolved issues for a specific version ID, if it return 0 ---> execute "release_version"

 

I hope this will help

tony cameraman August 30, 2018

I tried this and it was working. I couldn't complete it, because i could not find the Version ID. I have the name for each project and versions. I am trying to figure out the ID's. Once I complete it i will mark yours as answer. Thank you for the help!!

tony cameraman September 3, 2018

can you tell what is "self". Most of the functions created are having "self" as one of the parameters. What should i define it?

Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2018

Use self to represent the instance of the class

you can find more information here

tony cameraman September 6, 2018

 is it possible to find the IssueID if it is unresolved in a version?

Deleted user July 9, 2019
class myJIRA(JIRA):
def release_version(self, name, project):
version = self.get_project_version_by_name(project, name)
if version:
version.update(released=True)

 

This is new method "release_version" in redefined class

1 vote
Chris Nicosia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2018

@tony cameraman please check out this previously answered question to see if it resolves your question: https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-release-a-version-using-REST-api/qaq-p/563559

0 votes
Appicsoftwares
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2021

If you want more information then visit https://appicsoftwares.com/react-native-app-development

Suggest an answer

Log in or Sign up to answer