Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get to the avatar/image of a Jira user through SOAP or other means

I'd like to display the user avatars/images of developers registered with a Jira project. Jira has a web service API (my version is 4.2), but unfortunately I can't find an action that would extract the user avatar. There are just actions to extract project avatars.

Does anybody happen to know how to achieve this?

The user avatar can also be reached via an URL, but I need to authenticate first. I have the credentials (otherwise I wouldn't be able to make my other SOAP calls) and basic realm authentication should work, but doesn't. I am always thrown back to a login JSP. I haven't investigated from here on yet, so if someone has a cleaner idea through SOAP or however this is supposed to work in Jira thank you in advance!

Cheers, Vedran

like image 237
vlerenc Avatar asked Feb 22 '11 08:02

vlerenc


People also ask

Where are Jira avatars stored?

The icons are located in the proper Jira directory and proper folder: <Jira_install>/atlassian-jira/images. <Jira_home>/data/avatars.

How do I select an avatar in Jira?

click on the avatar icon on the bottom left. Then "Profile" (a new tab opens). Then when clicking into your current avatar picture you can change it.

How do I change user icon in Jira?

Go to Administration ( ) > User Management. Click on the user whose avatar you wish to change and select View Public Profile at the top right of the user screen. Click on the Avatar image and it should bring up a screen to allow you to select a new avatar or upload a file.

How do I use Gravatar in Jira?

To enable Gravatars for JIRA, go to Administration > Issues > General Configuration > Edit Configuration and select ON under the Use Gravatar for user avatars option.


1 Answers

You can get it using the REST API, e.g. GET http://jira.atlassian.com/rest/api/latest/user?username=lmiranda (you need to be logged in to access user information in JIRA).

Example response:

{
   "self":"http://jira.atlassian.com/rest/api/latest/user?username=lmiranda",
   "name":"lmiranda",
   "emailAddress":"... at atlassian dot com",
   "avatarUrl":"http://jira.atlassian.com/secure/useravatar?size=large&ownerId=lmiranda",
   "displayName":"Luis Miranda [Atlassian]",
   "groups":{
      "size":5,
      "items":[

      ]
   },
   "expand":"groups"
}

See the REST API Documentation for more info.

like image 72
luuuis Avatar answered Oct 23 '22 04:10

luuuis