It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can not create a release version via the REST API calls. Can create it manually.


I'm trying to create a release version in JIRA via a REST API call.
I have access to do this manually from the UI.

I can also fetch the current release versions, so my session cookies should be OK.

Getting a 404 saying "errorMessages":["Project with key \\'XXX\\' either does not exist or you do not have permission to create versions in it." when try to do the POST.

Code below:-


import requests
import json
import getpass

user_name = input("Please enter your user name (Provide with quotes. Ex :- 'john.smith'):- ")
password = input("Please enter your password (Provide with quotes. Ex :- 'abc123'):- ")

response_init ="",
data='{ "username": "' + user_name + '", "password": "' + password + '" }',
headers={"Content-Type": "application/json"})

cookie_name = response_init.cookies._cookies['']['/']['JSESSIONID'].name
cookie_value = response_init.cookies._cookies['']['/']['JSESSIONID'].value

cookie = cookie_name + "=" + cookie_value

# I can fetch the current versions for the project. So I guess my access cookie is working.
response_get = requests.get("", headers={"Cookie": cookie})

body = json.dumps({
"self": "",
"description": "Created @ CodeIT",
"name": "2019-Jul-WK28",
"archived": "false",
"released": "false",
"releaseDate": "2019-07-12",
"project": "XXX",
#"projectId": 33072,
"id": "33072",
"overdue": "false"

headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Bearer": cookie

# This is the request which is failing.
response_post = requests.request("POST", "", data = body, headers = headers)

print response_post.status_code
if response_post.status_code == 200:
print "you did it!!"



2 answers

Viraj, hi!


Make sure that user, which creates version has all permissions for this.

Well as I mentioned this user can create it manually via the Web UI. It's only the REST call which is not working.

I saw this :-


Anyone know what OAuth scopes means in there??


Are you sure your auth headers are right? I think you need something like:

"Authorization: Bearer " + cookie_value


Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you