So I'm trying to upload profile pictures for our Active Directory. I was able to accomplish this in Jira, but I'm having some issues with setting the picture in Confluence (getting the picture isn't a problem).
I've been trying to use the
void setUserProfilePicture(com.atlassian.user.User targetUser,
String imagePath)That is documented here: https://docs.atlassian.com/ConfluenceServer/javadoc/7.2.1/index.html?index-all.html
I'm thinking I'm having a problem with this sentence: The path should be the web-application-root-relative path to the image to be used as the user's profile picture
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.user.UserAccessor
def userAccessor = ComponentLocator.getComponent(UserAccessor)
confUser = userAccessor.getUserByName("boisvers")
userAccessor.setUserProfilePicture(confUser, "/data/atlassian/application-data/confluence/scripts/data/Oscar.jpg")
I did notice that if I manually upload my profile picture, then run the script. The manual profile pic is removed and replaced with the silhouette avatar.