Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to set the component filed prom python by rest api

Mayank Jindal
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!
September 13, 2019

Hello All,

 

I am new to this platform. I am trying to update a jira component by jiRA api call in python but its giving me an error, 

any help would be highly appreciated. please find the below code and error

 

r = requests.put('https://onejira.company.com/rest/api/2/issue/xyz-13016'
, headers = {'Authorization': "Basic abcd",'cache-control': "no-cache"}
, data = json.dumps({"update" : {"components" : [{"set" : [{"name" : "Automation"}]}]}})
)
r.raise_for_status() 

 

Its giving me error code 415 Client Error: for url  

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
February 11, 2021

You can wrap like this https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/jira.py#L805 :) 

in your situation I see is related to the component json. 

Please, validate via postman. 

I like to double check via dev tools from browser

Suggest an answer

Log in or Sign up to answer