I am trying to get all the groups that a specific user is a member of.
I am trying the following:
ReferenceType newUserReference = getCommandSession().getUserReferenceByName("user"); //method that gets a ReferenceType object for the desired user using QueryService
User user = getCommandSession().getUserByReference(newUserReference);
for(ReferenceType groupReference : user.getGroupRefs())
{
System.out.println(groupReference.getName());
}
The for loop is never entered, regardless of what user name I specify. I have tried users that are vApp Authors and users that are OrganizationAdministrators. (All my users are in groups, which show up in the group roles section of their properties in the UI).