The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to create avatar issuetype in JIRA Server using JIRA Server REST API oauth client?

Deleted user
November 1, 2018

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#auth/1/session-login uses basic authentication and cookies, in curl, to create an avatar issuetype. However, I am not seeing an example using JIRA REST API oauth client. 

 

I have tried the equivalent of the curl command below using Java and successfully got the JSESSIONID from the response header.

 curl -c cookiejar.txt -X POST -u admin:admin -H "X-Atlassian-Token: no-check" \
   -H "Content-Type: image/png" --data-binary @mynewavatar.png \
   'http://localhost:8090/jira/rest/api/2/issuetype/1/avatar/temporary?filename=mynewavatar.png'

 

However, when I add a cookie with the same JSESSIONID to the second request, it returned a 500 response code with the following message:

com.google.api.client.http.HttpResponseException: 500
{"errorMessages":["Uploading the avatar has failed. Please check that you are logged in and have sufficient permissions."],"errors":{}}

 

I also tried getting the JSESSIONID using basic authentication and passed the JSESSIONID to the second request....that worked.

 

Could someone please explain to me why basic authentication JSESSIONIDs work but JIRA Server REST API oauth client JSESSIONIDs do not? 

 

Thank you in advance.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Andrea Guarino
April 1, 2019

Same here! Any explanation? 

TAGS
AUG Leaders

Atlassian Community Events