Trying to make an update using curl to call REST API' and get a Method Not Allowed. It appears I'm limited to only GET, OPTIONS and HEAD http methods - why is this?
Code below:
C:\Program Files (x86)\Git\bin>curl -D- -u myuser:password -X POST --data d
ata.txt -H "Content-Type: application/json" https://nebula.atlassian.net/rest/ap</em<>>
i/latest/issue/TESTPROJ-15
HTTP/1.1 405 Method Not Allowed
Server: nginx
Date: Sat, 04 Feb 2012 19:21:57 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
X-AREQUESTID: 681x56410x1
Set-Cookie: JSESSIONID=C6FC86653753C6E10F5C7B9E12F65D81; Path=/; HttpOnly
Set-Cookie: studio.crowd.tokenkey=""; Domain=.nebula.atlassian.net; Expires=Thu,
01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
X-Seraph-LoginReason: OUT
Set-Cookie: studio.crowd.tokenkey=xs9nYBF0f20rkpxMLv4tMg00; Domain=.nebula...
You don't want to POST to editmeta. Editmeta is a template that will provide you with the sample body to use when you want to edit an issue. To edit an issue, you need to use a PUT against the issue resource. BTW, this is only available in JIRA 5. If it's not working for you, you're likely not on JIRA 5 yet.
If you want to play with the REST API in JIRA 5, go to https://jira.atlassian.com/plugins/servlet/restbrowser#/com-atlassian-jira-rest-jira-rest-filter (make sure you log in first).
Yes, just confirmed our OnDemand version is 4.4.1-studio-rc3. Crap. What is the process for upgrading / requesting upgrade to versoin 5? If I can't update issues through the REST API's, then they are of no use to us.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OnDemand will be upgraded with JIRA 5 when it comes out. Another option is to use the XML-RPC/JSON-RPC updateIssue method (https://jira.atlassian.com/plugins/servlet/restbrowser#/com-atlassian-jira-ext-rpc-soap).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the version of JIRA this is using, the site isn't too giving?
To recap, JIRA 4.4.4 doesn't support POST to /issue http://docs.atlassian.com/jira/REST/4.4.4/
The 'latest' 2.0alpha api http://docs.atlassian.com/jira/REST/latest doesn't support POST to /issue
5.0rc3 does http://docs.atlassian.com/jira/REST/5.0-rc3/
To clarify earlier, you need to use PUT, not POST (with 5.0rc3+). But your not using 5.0 yet, so sorry if this doesn't actually help you get working now :x
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reference, my answer is correct, it appears the example documentation is not. You probably want to be posting to https://nebula.atlassian.net/rest/api/latest/issue/TESTPROJ-15/editmeta
I've added a note on the page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Posting to https://nebula.atlassian.net/rest/api/latest/issue/TESTPROJ-15/editmeta gives me the following error:
HTTP/1.1 404 Not Found
Server: nginx
Date: Sun, 05 Feb 2012 21:49:15 GMT
Content-Type: application/xml;charset=UTF-8
Connection: keep-alive
X-AREQUESTID: 829x57321x1
Set-Cookie: JSESSIONID=DCC44AEC770B65F8EC9A1D76ADD65F20; Path=/; HttpOnly
Set-Cookie: studio.crowd.tokenkey=""; Domain=.nebula.atlassian.net; Expires=Thu,
01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
X-Seraph-LoginReason: OUT
Set-Cookie: studio.crowd.tokenkey=8lX2J1wuWwKoZkgEqCAH1g00; Domain=.nebula.atlas
sian.net; Path=/; HttpOnly
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=B303-TZX0-KCYS-05LX|49ae25bf0d403b34f6ef0b42c86
e1e28bd552d66|lin; Path=/
X-AUSERNAME: corysandahl
Cache-Control: no-transform
Content-Length: 102
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404<
/status-code></status>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm drawing from the example provided in the Jira REST API Tutorials found here:
https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues
The specific example I am trying to replicate is to change the assignee like the example below:
This simple edit
curl -D- -u fred:fred -X PUT --data {see below} -H "Content-Type: application/json" http: //kelpie9:8081/rest/api/2/issue/QA-31 |
example input data
{ "fields" : { "assignee" :{ "name" : "harry" } } } |
You should just receive a response with a status of "204 No Content"
So my call to:
C:\Program Files (x86)\Git\bin>curl -D- -u myuser:password -X POST --data data.txt -H "Content-Type: application/json" https://nebula.atlassian.net/rest/api/latest/issue/TESTPROJ-15
Follows this pattern. My data.txt contains:
{
"fields": {
"assignee":{"name":"newuser"}
}
}
Whether PUT or POST is the desired method, neither are allowed in my case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error is correct, your API call is not valid for that /issue/{key} service. According to the API for issue resource URLS as you have them, POST is only available in some specific sub cases. What are you tryinig to update anyway, just POSting to the issue seems a little, vague? The current JIRA 5 RC3 APIs show some improvement, with a lot of attributes exposed through PUT, however not the one you are trying to use, I doubt the server you are using has yet moved to JIRA 5.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.