0

I'm trying to add some values to a issue picker custom field in Jira, using Python.

I'm getting <Response [405]> and no value has been added.

The code I'm running:

import requests
import json

key = "TES-78"
Cus1 = "customer_name"

url = "https://**Company_Name**/rest/api/2/issue/"+key

headers = {
 'Authorization': 'Basic **************',
 'Content-Type': 'application/json',
 'Cookie': 'JSESSIONID=***; atlassian.xsrf.token=***'
}

payload = json.dumps({

"update": {
   "customfield_12301": [{"add": {"summary": Cus1}}]
}
})

response = requests.request("POST", url, headers=headers, data=payload)
print(response)

anyone knows how can I add values to the issue picker field? Thanks!

1 Answer 1

1

HTTP 405 is "Method Not Allowed": Mozilla Developer link

So, the server just telling you that you should use different HTTP method.

For updating a custom field value in Jira, you should use "PUT" method instead of "POST".

You can find details from this Atlassian Developer page.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.