Am running into a problem when using the "editmeta" url to add labels via the rest api. When trying to add a label using the editmeta tag with curl, I get a "HTTP/1.1 405 Method Not Allowed" message.
The URL i am using is "https://URL/rest/api/2/issue/XXXXXX/editmeta/" and the json is:
{ "update": { "labels": [ { "add": "newlabel" } ] } }"
I have tried this with POST and PUT. Any idea why this is happening ?
Community moderators have prevented the ability to post new answers.
Hey Nelson,
There's a known problem with the editmeta URL that you can see here, but you can add label with the following command:
curl -u 'admin:pass' -H "Content-Type: application/json" -X PUT --data '{ "update": { "labels": [ {"add": "newlabel"} ] } }' http://jira.example/rest/api/2/issue/TEST-1
Cheers
Editmeta is read-only resource (GET only) that gives you issue edit metadata. To update lables you should PUT your request to right to the issue resource: rest/api/2/issue/{issueIdOrKey}
See PUT operation for issue resource with issue id or key on https://docs.atlassian.com/jira/REST/latest/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.