How to build the payload for a status update (transition) restkit Resource

Hi, I've seached for an example of how to build the payload for a status update (transition). I've tried something like this:

pdata = {"transitions": {"id":"81","name":"Systemtest av leveransen","to":{"self":"","description":"","iconUrl":"","name":"Systemtest av leveransen","id":"10190"},"fields":{}}}


response = resource.put(headers={ "Content-Type": "application/json" }, payload=json.dumps(pdata))

I get errors like these:


EXCEPTION: {"errorMessages":["one of 'fields' or 'update' required"],"errors":{}}

If I use pdata = {"fields": {"status": { ... i get


XCEPTION: {"errorMessages":[],"errors":{"status":"Field 'status' cannot be set. It is not on the appropriate screen, or unknown."}}

I can update other simple fields . But find transtions like stataus complicated.

If i expand the transition with:

I get


[{"id":"81","name":"Systemtest av leveransen","to": {"self":"","description":"","iconUrl":"","name":"Systemtest av leveransen","id":"10190"},"fields":{}}, {"id":"91","name":"Tilbake til systemtest i iterasjonen","to":{"self":"","description":"","iconUrl":"","name":"Systemtest i iterasjonen","id":"10188"},"fields":{}}



I've checked but i find it complicated to understand.

Can someone, please, help me with som tips an syntax tip. It's a bit complicated to understand. I think I need a concrete/spesific tip. I'm sure it's simple when it's build correctly - but there are so many combinations.

Please help me :-)

Thanks a lot.

1 answer

The problem was that I had to use POST, not PUT.

The payload got really simple:

'transition': {
'id': 81 # Resolved (for my setup)
I now got HTTP 405. This is most probably related HTTP/HTTPS.
I found it much more simple to use urllib instead of restkit. See my final solution below:
import urllib
import urllib2
import base64
import json
key = 'MYISSUE'
#comment = "It's done!"
username = 'xxxx'
password = 'yyyy'
auth = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
data = json.dumps({
'transition': {
'id': 81 # Resolved (for my setup)
request = urllib2.Request(url, data, {
'Authorization': 'Basic %s' % auth,
'Content-Type': 'application/json',
print urllib2.urlopen(request).read()

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

819 views 2 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you