2
votes

I have a set of Microsoft Teams that I'm unable to add a Microsoft Planner tab to. When I try and add the Planner I get the dialog and put in the Planner name and click Create and it gives back a Create Plan Failed message. No other information is returned.

This happens doesn't happen in all Microsoft Team, ones that are created normally in the teams app work fine, but ones that I create through the Microsoft Graph have this problem. Here is the code that I'm using to create the team.

public async Task<string> CreateTeam(string title, ClaimsPrincipal user)
{
    var userId = user.Claims.First(c => c.Type == "http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
    var body = $"{{\"displayName\":\"{title}\",\"groupTypes\":[\"Unified\"],\"mailEnabled\":true,\"mailNickname\":\"{title.Replace(" ", "")}\", \"securityEnabled\":false, \"visibility\":\"Private\" }}";
    var res = await GraphClient.QueryGraphAsyncPost($"/groups", body, user);
    var result = await res.Content.ReadAsStringAsync();
    var group = JsonConvert.DeserializeObject<FieldInfoBucket>(result);
    var id = group.Id;

    res = await GraphClient.QueryGraphAsync($"/groups/{id}/owners", user);
    result = await res.Content.ReadAsStringAsync();

    body = $"{{\"@odata.id\": \"https://graph.microsoft.com/beta/users/{userId}\"}}";
    res = await GraphClient.QueryGraphAsyncPost($"/groups/{id}/owners/$ref", body, user);
    // ReSharper disable once RedundantAssignment
    result = await res.Content.ReadAsStringAsync();

    body =
        $"{{\"memberSettings\":{{\"allowCreateUpdateChannels\":true, \"allowDeleteChannels\":true, \"allowAddRemoveApps\":true, \"allowCreateUpdateRemoveTabs\":true, \"allowCreateUpdateRemoveConnectors\":true}}, \"guestSettings\":{{\"allowCreateUpdateChannels\":false, \"allowDeleteChannels\":false}}, \"messageSettings\":{{\"allowUserEditMessages\":true, \"allowUserDeleteMessages\":true, \"allowOwnerDeleteMessages\":true, \"allowTeamMentions\":true, \"allowChannelMentions\":true}},\"funSettings\":{{\"allowGiphy\":true, \"giphyContentRating\":\"strict\",\"allowStickersAndMemes\":true,\"allowCustomMemes\":true}} }}";
    res = await GraphClient.QueryGraphAsyncPut($"/groups/{id}/team", body, user);
    // ReSharper disable once RedundantAssignment
    result = await res.Content.ReadAsStringAsync();

    return id;
}

The Graph client above simply issues Get/Post/Put commands against the graph.microsoft.com/beta endpoints and adds the appropriate Bearer token.

1
Planner is getting confused that its being asked by a user who's not a member of the team. If we add current logged in user (owner) explicitly using /AddMember api then it's workign fine. We are working on the fix. Meanwhile could you please try this at your end and confirm?Wajeed-MSFT

1 Answers

2
votes

Planner is getting confused that its being asked by a user who's not a member of the team. If we add current logged in user (owner) explicitly using /AddMember api then it's workign fine. We are working on the fix.