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
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]
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.