Avatar URL image override by first latest for all previous group when create new one

Hi all,

Avatar URL image override by first latest for all previous group when create new one, mean to say when i creates a group by using group creation API and provide avatar image the avatar image for all previously created group by code become default.png 

  • There is not enough information here.  Please provide the actual work you are doing to reproduce this.  

  • #set($groupResponse1 = $core_v2_group.Create($name, $groupType, "%{ AvatarFileData = $avatarFileDataArg, AvatarFileName = $avatarFileNameArg}"))


    i am using above code to create group (suppose group 1) by passing AvatarFileData and AvatarFileName it is creating a group with Image URL on AvaratUrl property and i am getting my image url on Avatar Url.

    Now i am going to use the above code to create one another group supposes group 2 by passing AvatarFileData and AvatarFileName.
    Now what i am seeing group 1's AvatarUrl get lost and new Group's 2 Image Url is Perfectly coming and the same for Group 2 whencreating group 3 and so on

  • How are you populating $avatarFileDataArg? It is recommended to instead use AvatarFileName and AvatarFileUploadContext. The parameter AvatarFileData is documented as a string but is expected to be a byte array which is difficult to provide via Velocity script.

  • #set($imageData = $core_v2_uploadedFile.Get($contextId, $fileName))
    AvatarFileData = $imageData.FileData

  • Are you creating groups in a loop? I'm having trouble reproducing the issue. Could you share more of your code or provide a minimal issue reproduction script?

  • No I am not using loop,We have developed a UI to create group, we are just creating a group when user click on save button after filling all group info by below code

    #set($name = $core_v2_page.GetFormValue('Name'))
    #set($description = $core_v2_page.GetFormValue('Description'))
    #set($groupType = $core_v2_page.GetFormValue('GroupType'))
    #set($fileName = $core_v2_page.GetFormValue('fileName'))
    #set($fileUrl = $core_v2_uploadedFile.GetUploadUrl($contextId))
    #set($parentGroupId = $core_v2_page.GetFormValue('parentGroupId'))
    #set($imageData = $core_v2_uploadedFile.Get($contextId, $fileName))

    #set($groupResponse = $core_v2_group.Create($name, $groupType, "%{ AvatarFileData = $imageData.FileData, AvatarFileName = $imageData.Name, Description = $description, ParentGroupId = $parentGroupId}"))

    you can consider that parent id for every group would be same

  • It appears that the save order within this API is incorrect. If you add the avatar after the group is created (via an edit), the avatars should work correctly. 

    I've logged the issue with specifying the avatar on create as a bug:

    TE-16351: Avatar specified on group creation is not saved correctly