It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Cannot update Jira issue fields via REST API (in Python)

I am using this code:

payload = {'update': { 'summary': [ {'set': 'new summary here'} ] } }

url = 'https://my-jira-server/resr/api/2/issue/CCB-666'

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',

requests.put(url, headers=headers, data=payload)

The call fails with error 400 with this message:

"Unexpected character ('u' (code 117)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')"

I've verified that the 'u' it refers to is the start of the 'update' in the payload.

What am I doing wrong here?


3 answers

1 accepted

1 vote
Answer accepted

Found the solution!

After re-reading requests() documentation here:, in the section titled 'More complicated POST requests',

I changed the code to this:

requests.put(url=url, headers=headers, json=payload)

and it worked.

hello @Amir Katz ,

the u before a string in python stands for Unicode. 
You should check on why your python code is considering the payload as Unicode and not utf-8

No it's not. When I changed the key 'update' to 'Xupdate' I got the error on the character 'X'.

So the API is expecting a different JSON structure, but it's unclear what exactly.

@Amir Katz my mistake, I read the quesiton quickly.

have you tried double quotes instead of the single quote?
the JSON format seems correct.

if you still can't find your solution, I usually use the jira-python  module.

Than ks. But this code is in Python, so single- and double-quotes are the same - a string.

Regarding the jira-python module, I'm aware of it, but it is quite complicated to use. I used it in the past on Linux.

I did try to install it, and it failed when it was trying to compile some SSL-related code.

This is on Windows 10...

I guess the latter problem is for another thread.

Hi Amir,


Does quoting the whole payload/data object help?



payload = {'update': { 'summary': [ {'set': 'new summary here'} ] } }


payload = '{"update": { "summary": [ {"set": "new summary here"} ] } }'



I don't really give this a lot of hope but other than that the request looks fine to me so.. My $0.02



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Introducing new features for Jira Software Cloud's roadmap

Hi Atlassian community, A few months ago, we offered a sneak peak of the new hierarchy view on the roadmap. Thank you for all the feedback (and excitement) and for helping us shape the direction of...

22,908 views 101 74
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you