I'm trying to add a non existent value to a drop down with empty list. Please check my code below and please let me know what is lacking.
I am following this documentation but I couldn't get it working.
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-post
def add_value():
url = "https://company.atlassian.net/rest/api/3/field/customfield_10000/option"
auth = HTTPBasicAuth(user, token)
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
payload = json.dumps( {
"options": [
{
"disabled": "false",
"value": "Scranton"
},
{
"disabled": "true",
"value": "Manhattan"
},
{
"disabled": "false",
"value": "The Electric City"
}
]
})
response = requests.request(
"POST",
url,
headers=headers,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
=====
Error:
{
"errorMessages": [
"No content to map to Object due to end of input"
]
}