Google app script. Add a group inside another group with AdminDirectory.Members.insert

37 Views Asked by At

I have a function that, based on a spreadsheet, retrieves users from groups and allows me to modify permissions and add or remove users from the group. The issue is that there are groups that are composed of other groups.

I'm using the functions

  • AdminDirectory.Members.insert
  • AdminDirectory.Members.update
  • AdminDirectory.Members.remove, which work correctly with users. However, if I try to do the same with a group, I receive the error "API call to directory.members.insert failed with error: Invalid Input: memberKey".

It seems that the email of a group is not considered valid as a user email to add it to the group. I have no more ideas of how to do it.

const member = { email: userEmail, role: "MEMBER" }; AdminDirectory.Members.insert(member, groupEmail);

0

There are 0 best solutions below