The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Test cycle creation via API

Prasad Rajassekaran
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!
October 5, 2020

I am trying to create test cycle in zephyr from python scripts but getting multiple errors while making an API call. Could someone correct me where I am going wrong?

**Note:**

The tested credentials in my code are valid.

**With Encoding:-**

import base64
from json import dumps

import requests

newCycleValues = dumps({
"clonedCycleId": "",
"name": "Foo",
"build": "",
"environment": "",
"description": "",
"startDate": "",
"endDate": "",
"projectId": "1234",
"versionId": "1234",
"cloneCustomFields": False
})

baseURL = 'https://foo.foonet'
createCycleURL = baseURL + '/rest/zephyr/latest/cycle'
headers = {"Authorization": "Basic " + str(base64.b64encode(bytes('foo' + ":" + 'boo', 'utf-8'))), "Content-Type": "application/json"}

x = requests.post(createCycleURL, data=headers, json=newCycleValues)

print(x.text)
print(x.status_code)

**Error:-**

{} 403

**Without Encoding:-**

import base64
from json import dumps

import requests

newCycleValues = dumps({
"clonedCycleId": "",
"name": "Foo",
"build": "",
"environment": "",
"description": "",
"startDate": "",
"endDate": "",
"projectId": "1234",
"versionId": "1234",
"cloneCustomFields": False
})

baseURL = 'https://foo.foonet'
createCycleURL = baseURL + '/rest/zephyr/latest/cycle'
headers = {"Authorization": "Basic " + 'foo' + ":" + 'boo', "Content-Type": "application/json"}

x = requests.post(createCycleURL, data=headers, json=newCycleValues)

print(x.text)
print(x.status_code)

**Error:-**

{} 403

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
nmenere
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 12, 2020

Hi @Prasad Rajassekaran ,

This community space is for the Automation capabilities within Jira. You may have better luck contacting Zephyr or trying another space.

 

Cheers,

Nick [Atlassian - Automation Group Product Manager]

TAGS
AUG Leaders

Atlassian Community Events