Changing issue type with Rest API V3 Cloud, Return 415, even if editmeta say it's allowed value

jbrossard
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 27, 2020

1) I did a GET to "https://xxxx.atlassian.net/rest/api/3/issue/{issue_key}/editmeta"
2) I made sure that the allowedValues for issueType, I can see the issueType I want to change to.
3) I did a PUT to https://xxxx.atlassian.net/rest/api/3/issue/{issue_key} 


auth = HTTPBasicAuth("xxxx@xxxx.com", API_TOKEN)
headers = {"Accept": "application/json"}
payload= json.dumps({fields": {"issuetype":{"id": "0000" } }})

response = requests.request(

"PUT", url, headers=headers,

auth=auth,

data=payload

)

print(response)   

 

BUT, this give me <Response [415]>

 

What is happening ?

1 answer

1 accepted

0 votes
Answer accepted
Hazwan Ariffin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2020

So 415 indicates Unsupported Media Type. Could you try adding content type in your header, e.g Content-Type: application/json, and see if that changes anything.

My curl command would typically look like this:

curl --request POST \
--url 'https://<yourDomain>/rest/api/3/issue/<issueKey>/comment' \
--header 'Accept:application/json' \
--header 'Content-Type: application/json' \
--user '<atlassianAccountemail>:<APIToken>' \
--data '{
"body": "Charlie"
}'
jbrossard
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2020

Thanks, it work!

Suggest an answer

Log in or Sign up to answer