question

NicolasCesarHuancaPastor-3467 avatar image
0 Votes"
NicolasCesarHuancaPastor-3467 asked saldana-msft edited

Microsoft Graph Team owner not found for group

I have aproject project in Java. When I run the project I got a error: Error message: Team owner not found for group, Someone would said me how to fix it?.

final ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
.clientId("xxxx")
.clientSecret("yyyy")
.tenantId("zzzzz")
.build();
List scope = new ArrayList<>();
scope.add("https://graph.microsoft.com/.default");
final TokenCredentialAuthProvider tokenCredentialAuthProvider = new TokenCredentialAuthProvider( scope, clientSecretCredential);

final GraphServiceClient graphClient =
GraphServiceClient
.builder()
.authenticationProvider(tokenCredentialAuthProvider)
.buildClient();

Group group = new Group();
group.description = "Group with designated owner and members2025";
group.displayName = "Operations group2025";
LinkedList groupTypesList = new LinkedList();
group.groupTypes = groupTypesList;
group.mailEnabled = false;
group.mailNickname = "operations2025";
group.securityEnabled = true;

group.additionalDataManager().put(""owners@odata.bind"", new JsonPrimitive("[ "https://graph.microsoft.com/v1.0/directoryObjects/1111"]"));
group.additionalDataManager().put(""members@odata.bind"", new JsonPrimitive("[ "https://graph.microsoft.com/v1.0/directoryObjects/22222"]"));

Team team = new Team();
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.allowCreateUpdateChannels = true;
team.memberSettings = memberSettings;
TeamMessagingSettings messagingSettings = new TeamMessagingSettings();
messagingSettings.allowUserEditMessages = true;
messagingSettings.allowUserDeleteMessages = true;
team.messagingSettings = messagingSettings;
TeamFunSettings funSettings = new TeamFunSettings();
funSettings.allowGiphy = true;
funSettings.giphyContentRating = GiphyRatingType.STRICT;
team.funSettings = funSettings;

graphClient.groups(graphClient.groups().buildRequest().post(group).id).team()
.buildRequest()
.put(team).id;

Message response:

2021-08-01 03:08:14.334 ERROR 19944 --- [ main] global : CoreHttpProvider[sendRequestInternal] - 396Graph service exception Error code: BadRequest 2021-08-01 03:08:14.336 ERROR 19944 --- [ main] global : CoreHttpProvider[sendRequestInternal] - 396Error message: Team owner not found for group

microsoft-graph-mailmicrosoft-graph-identity
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Deva-MSFT avatar image
0 Votes"
Deva-MSFT answered DnyaneshwarSurywanshi-3200 commented

I would try the following in the order:

1) Create the group
2) Give some time/say 1-2 minutes - so that in the backend in creates the group & values (to avoid any sync/latency issues)
3) Create a team & associate the above created group.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I I have added code for: Wait two minutes (for create the group), but it doesn't work.
I got the same error: Error message: Team owner not found for group

123221-imagen.png


0 Votes 0 ·
imagen.png (65.7 KiB)

@NicolasCesarHuancaPastor-3467 I have followed your steps but still getting same error.

0 Votes 0 ·