Search code examples
liferayliferay-6portletliferay-7liferay-7.1

How to get users associated with a team in Liferay


I Need to fetch Team associated with the group in Liferay.

  • First I created the User
  • Then I made a group
  • Then I made a Team
  • The team is associated with the group
  • so I fetch the user, who is login
  • then I fetch the group which is associated with it
  • Now I am not able to fetch the team from the group

Need Some Help

I do this thing but, from this, I got all the team which is created, I need a team which is associated with a specific group

long groupId = themeDisplay.getLayout().getGroupId();
List<Team> teamGroup=TeamLocalServiceUtil.getGroupTeams(groupId);

Solution

  • I Got Solution

    You can Fetch Team associated with the Group

        //you have to first find user group id than pass it simply
    
        TeamLocalServiceUtil.getUserGroupTeams(userGroupId));