'Adding values to Jira Issue picker custom field using python

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!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source