JIRA REST API - update issue - what is the right return code?

Kinto Soft
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.
May 28, 2012

Hi,

I'm updating an issue by using the REST API:

http://docs.atlassian.com/jira/REST/latest/#id162347

The update process works fine (changes are really applied) but there is a problem in the PUT method response.

The Atlassian's documentation above says:

============================================

200 - application/json [collapse]

Returned if it updated the issue succesfully.

=============================================

As the issue was successfuly updated, then a json/document is expected as result, but the JIRA 5.0 Server sends nothing (no message body). This causes a problem when the REST API is invoked from some HTTP clients.

On the other hand, if the API is invoked by using CURL everything goes fine:

==============================================

HTTP/1.1 204 No Content
Server: Apache-Coyote/1.1
X-AREQUESTID: 1207x184x1
Set-Cookie: JSESSIONID=9B8964B10E3725B88FF2795B31BD44BF; Path=/
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=BP8Q-WXN6-SKX3-NB5M|bdfdb72db11ef234534acc6d0b0f0efed7e04340|lin; Path=/jira
X-AUSERNAME: admin
Date: Tue, 29 May 2012 18:07:45 GMT
=============================================

In this last case, the HTTP return code is 204 instead of 200. 204 would be OK because no response body is sent.

What is grong? The documentation or the implementation?

Regards,

Pablo

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Kinto Soft
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.
May 29, 2012

Sure the implementation is OK and the documentation is wrong.

I've modifed the Adobe's BlazeDS HTTP client implemetation to deal with 204 return codes and now it's working fine.

TAGS
AUG Leaders

Atlassian Community Events