10 thoughts on “Displaying the current user’s profile picture in Confluence

  1. Thom W Gray

    Simon,

    I got this to work:

    —————————————————-
    You are: {report-image:global:current user > user:picture} {report-info:global:current user > full name}
    —————————————————-

    Now what I’d like to know is how to display the picture of a specific user on a page. Any thoughts there?

    Thom

    Reply
  2. Simon

    Hi Thom, thanks for the comment. Looking at the documentation, there’s an example of :

    {report-image:content:creator > user:picture}

    and the recipe for Contact Cards shows the macro being used within another context. I’d suggest asking the question in the comments over there; David Petersen, one of the main guys at Customware, is always very helpful.

    Reply
  3. Liz Armstrong

    You are a life saver. I have been trying to get the profile picture displayed in a business card layout for our dashboard for a month. Adaptavist and Atlassian documentation have been no help. Thank you! Thank you! THANK YOU!

    Reply
  4. simonwheatley Post author

    Hi Liz, thanks for dropping by and I’m glad this was helpful! If you’re using this, or any other recipe, to display the user profile picture in multiple situations, beware – all the methods I’ve tried fail in one place or another, so be sure you’ve checked everywhere. If you’re just using it in one location, like a standard Confluence page, then it’s not a worry.

    Reply
  5. Denise Van

    Hey Simon,

    I know it’s been a while since you added this entry but I just tried your macro and it’s not working. =( It says “Your profile picture” within a box that has an ‘X’ in it. The link works but the actual picture doesn’t show. I’m running Confluence 2.8 and using Theme Builder 3.2.1. I’m trying to use the macro within the title panel. Can you help?

    Reply
  6. Jean Damay

    Hi,

    The macro didn’t work for me too with Confluence 2.8.0

    My concern is a little bit different, because i wan’t to get profile picture of any user : so i add a parameter. Note that $req.userPrincipal.name is not working anymore (but why ??)

    #set($profile_pic=$userAccessor.getUserProfilePicture($param0))
    #set($pic_src=$profile_pic.getDownloadPath())
    #set($baseurl=$action.getGlobalSettings().getBaseUrl())

    Jean.

    Reply
  7. Tim

    Thanks. Works fine for me in 3.1

    If you want to show the pic of a certain user e.g. for a static team gallery you can use:

    {user_profile_pic:username}

    with the changed code:

    #set( $profile_pic = $userAccessor.getUserProfilePicture( $param0 ) )
    #set( $pic_src = $profile_pic.getDownloadPath() )

    Reply
  8. AlanP

    Simon,

    Thanks for sharing this. I’m using 3.4 and I needed to add the complete path to get it to work:

    #set($baseurl=$action.getGlobalSettings().getBaseUrl())
    #set( $profile_pic = $userAccessor.getUserProfilePicture( $req.userPrincipal.name ) )
    #set( $pic_src = $baseurl + $profile_pic.getDownloadPath() )

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>