Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JIRA REST update assignee - Tomcat HTTP 405 - Method Not Allowed

Jacques
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.
February 25, 2013

Hi,

I'm trying to assign an assignee to an existing JIRA issue with the following command:

curl -D- -u admin:admin -X POST --data C:\CURL\tests\assignuser.txt -H "Content-Type: application/json" http://jira.something.com/rest/api/2/issue/CRIE-30

The content of the assignuser.txt is the following:

{   "fields": {
       "assignee":{"name":"existingusername"}
   }
}

When executing this command line I get the following HTML response::

The admin user has full access to the issue which is in a "in progress" state and permits editing.

Anyone has any suggestion what I'm doing wrong?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
ConradR
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.
February 25, 2013

For basic auth you have to use the following header with "username:password" base64 encoded:

-H "Authorization: Basic YWRtaW46YWRtaW4="

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Basic+Authentication

Jacques
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.
February 25, 2013

Hi Conrad,

Not sure what authentication has to do with it. If I change username and/or password I will get a security notice that credentials are not valid. The issue above uses valid credentials.

Sure the article you mention states "If you need to you may construct..." but I have no need for Basic Auth headers since we're using it in a very secure environment.

ConradR
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.
February 25, 2013

Hi Jacques,

sorry, I just noticed you have a 405 and not a 403. In your case the problem is that this method doesn't exist for POST. You have to repeat the same request as PUT.

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

TAGS
AUG Leaders

Atlassian Community Events