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":"http://jira.adeo.no/rest/api/2/status/10190","description":"","iconUrl":"http://jira.adeo.no/images/icons/statuses/generic.png","name":"Systemtest av leveransen","id":"10190"},"fields":{}}}
...
response = resource.put(headers={ "Content-Type": "application/json" }, payload=json.dumps(pdata))
I get errors like these:
c:\Python27\Doc>python set_status.py
EXCEPTION: {"errorMessages":["one of 'fields' or 'update' required"],"errors":{}}
c:\Python27\Doc>python set_status.py
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:
http://jira.adeo.no/rest/api/2/issue/PKGIRAFF-1/transitions?expand=transitions.fields
I get
{"expand":"transitions","transitions":
[{"id":"81","name":"Systemtest av leveransen","to": {"self":"http://jira.adeo.no/rest/api/2/status/10190","description":"","iconUrl":"http://jira.adeo.no/images/icons/statuses/generic.png","name":"Systemtest av leveransen","id":"10190"},"fields":{}}, {"id":"91","name":"Tilbake til systemtest i iterasjonen","to":{"self":"http://jira.adeo.no/rest/api/2/status/10188","description":"","iconUrl":"http://jira.adeo.no/images/icons/statuses/generic.png","name":"Systemtest i iterasjonen","id":"10188"},"fields":{}}
]
}
I've checked https://docs.atlassian.com/jira/REST/5.2/#id251679 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.
The problem was that I had to use POST, not PUT.
The payload got really simple:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.