You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.