无法在 Microsoft Teams 中将 Planner 创建为选项卡 [英] Unable to create Planner as a Tab in Microsoft Teams

查看:120
本文介绍了无法在 Microsoft Teams 中将 Planner 创建为选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组 Microsoft Teams,我无法向其中添加 Microsoft Planner 选项卡.当我尝试添加 Planner 时,我会看到对话框并输入 Planner 名称并单击 Create,它会返回一条 Create Plan Failed 消息.不返回其他信息.

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.

这种情况不会发生在所有 Microsoft Team 中,在团队应用程序中正常创建的那些工作正常,但我通过 Microsoft Graph 创建的那些有这个问题.这是我用来创建团队的代码.

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;
}

上面的 Graph 客户端只是针对 graph.microsoft.com/beta 端点发出 Get/Post/Put 命令并添加适当的 Bearer 令牌.

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

推荐答案

Planner 感到困惑,因为它被非团队成员的用户询问.如果我们使用 /AddMember api 然后就可以正常工作了.我们正在修复.

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.

这篇关于无法在 Microsoft Teams 中将 Planner 创建为选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆