405 Method Not Allowed When updating via Editmeta

Nelson D
Contributor
January 6, 2014

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 ?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Tiago Comasseto
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.
January 6, 2014

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

0 votes
Nelson D
Contributor
January 6, 2014

Thanks a ton Tiago! That helped resolve the issue :)

0 votes
Aleksander Mierzwicki _
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2014

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/

TAGS
AUG Leaders

Atlassian Community Events