Forums

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

continued problems with the rest api

Tom Allison
Contributor
March 26, 2012

following the documented tutorial I submit a Json string ({fields:{summary:don't work}}) to an existing ticket by Key (PQCST-15488) and get a response of 405 Method not Allowed.

This is the same error I get for every single attempt to submit an update to any field, custom or otherwise.

in short I have a disconnect between what this says I can do: https://developer.atlassian.com/display/JIRADEV/Updating+an+Issue+via+the+JIRA+REST+APIs

and what I'm able to accomplish, which is nothing.

Just to validate the set up I went back and did verbatum curl statements.

Specifically:

curl -D- -u name:secret -X PUT --data '{body:does not work}' -H Content-Type: application/json http://csdevl301v.aa1.pqe:8000/rest/api/latest/issue/PQCST-14460/comment

Does not work, 405.

However I can create issues, nothing after that. And many of the fields defined for a given issue (custom fields) cannot be included in the json string to create the issue.

2 answers

0 votes
David Bullock September 3, 2013

If you do a GET on http://csdevl301v.aa1.pqe:8000/rest/api/2/issue/PQCST-15488/editmeta ... does it include the 'summary' field? If not, you won't be able to modify the 'summary' field because it doesn't appear on the edit screen for issues of that type. But if so, does it have a 'set' operation/verb? If not, then you have to use a different 'non-simple', 'operational based update' 'representation' to update it.

See:

https://docs.atlassian.com/jira/REST/latest/#idp1998512 (and expand the example for the application/json representation of the editmeta resource for a 200 response).

https://developer.atlassian.com/display/JIRADEV/Updating+an+Issue+via+the+JIRA+REST+APIs (the 'operation (verb) based update' section).

It's not your fault, entirely. That particular feature of this API isn't actually RESTful (PUT-ing a bunch of CRUD-like expressions is NOT the same thing as replacing the representation of the resource), although Atlassian have called it such, and you're expecting it to be such.

0 votes
Tom Allison
Contributor
March 27, 2012

Trying again another day.

submitting:

{ "fields": {"summary": "new summary"} }
to
curl -D- -u username:password -X PUT --data `echo $V` -H "Content-Type: application/json" http://csdevl301v.aa1.pqe:8000/rest/api/2/issue/PQCST-15488
returns
HTTP Status 415 -
Status report message
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method ().
Now, I'm taking this from the docs for the current version. Has anyone run into this? I have checked and I have the permissions on this system to create, edit, etc so that's not the issue. And I can create a ticket via REST. But not even the most fundamental update seems to be working.

Were is the disconnect in the documentation?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events