Microsoft Teams : “Failed to create the plan” error while adding Planner to Teams which are created using Graph APIs

Failed to add planner in Teams
Failed to add planner in Teams

Hi All,

LIFE IS BEAUTIFUL πŸ™‚ I hope we all are safe:) STAY SAFE, STAY HEALTHY πŸ™‚ STAY HOME πŸ™‚

Today new issue and solution πŸ™‚

Background / Use Case : We were provisioning Teams using Microsoft Graph APIs. We have our custom Teams creations form where user can order the Team.

We have following code: This is simple code. There are other settings as well while creating Groups.

JObject group = new JObject();
JArray owners = new JArray();

owners.Add($"https://graph.microsoft.com/v1.0/users/{ownerId1}");

JArray groupTypes = new JArray();
groupTypes.Add("Unified");

group["description"] = "group description";
group["displayName"] = "group display name";
group["groupTypes"] = groupTypes;
group["mailNickname"] = "group mail nick name"
group["owners@odata.bind"] = owners;

var strcontent = group.ToString();
var content = new StringContent(strcontent, Encoding.UTF8, "application/json");
var result = await hc.PostAsync("https://graph.microsoft.com/v1.0/groups", content);

var resultStr = await result.Content.ReadAsStringAsync();
if (result.IsSuccessStatusCode){
    //Group created successfully, provision the team

     var teamSettings = new Team{
	MemberSettings = new TeamMemberSettings
	{
		AllowCreateUpdateChannels = true
	}
    };

   var team = await hc.PutAsJsonAsync($"https://graph.microsoft.com 
              /v1.0/groups/{groupId}/team", teamSettings);
}

With this code we are successfully able to create group and then Teams. Everything is working fine with Team either from Team desktop client or Team Web client.

But issue occurs when one of the owner of one team tried to add the Planner as

Microsoft Teams : Adding Planner to the Team which are created using Microsoft Graph APIs
Fig1: Microsoft Teams : Adding Planner to the Team which are created using Microsoft Graph APIs

And then error occurs – “Failed to create the plan.” as

Microsoft Teams : Adding Planner to the Team which are created using Microsoft Graph APIs - Error - "Enable to create the plan"
Fig2 : Microsoft Teams : Adding Planner to the Team which are created using Microsoft Graph APIs – Error – “Enable to create the plan”

This error is in both in Teams desktop client and Team web client as well.

When we created the Teams from UI either through Teams desktop client or Teams web client, we are successfully able to add the Planner. So it seems this is the issue when we are creating Teams using Graph APIs.

After bit googling it found that this seems to be known issue and lots of colleagues has this issue. Following are few threads for such error for reference: https://delucagiuliano.com/microsoft-teams-failed-to-create-the-plan

https://stackoverflow.com/questions/59472710/microsoft-groups-teams-cant-create-plans-for-planner-app

https://github.com/microsoftgraph/microsoft-graph-docs/issues/7427

There is a user voice for the same as well – https://microsoftteams.uservoice.com/forums/908686-bug-reports/suggestions/39626701-planner-failed-to-create-plan

Solution: But then there is workaround as well πŸ™‚ And workaround is “Adding Owner as a Member as well” . When I changed the code and added Owners as a Members as well it worked like a charm πŸ™‚

Updated code: In above code added following line, added Owners as a Members as well –

group["members@odata.bind"] = owners;

After adding the above line, tested by creating new Teams and then owners could successfully add the Planner πŸ™‚ But then this works for new Teams, for existing Teams we need to write a script – so the next article, shearing the script soon πŸ™‚

Few more referenceshttps://docs.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-1.0&tabs=csharp

Creating a Teams Programmatically

Create Plan Failed when creating Planner in Microsoft Teams

How to resolve ‘Failed to create Plan’ from Microsoft Teams

Thanks for reading πŸ™‚ If its worth at least reading once, kindly please like and share. SHARING IS CARING πŸ™‚

Enjoy the beautiful life πŸ™‚ Have a FUN πŸ™‚ HAVE A SAFE LIFE πŸ™‚ TAKE CARE πŸ™‚

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

1 Response

  1. July 14, 2020

    […] In my previous article related to Microsoft Teams we discussed the issue while adding Planner to Teams which are created using Graph APIs and workaround – Microsoft Teams : β€œFailed to create the plan” error while adding Planner to Teams which are crea… […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: