Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

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]

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events