Giuliano De Luca | Blog |

Are you facing this issue? I hope this article will help you.
I recently ran into a problem in Microsoft Teams (see picture on top).
In particular, I got an error when I tried to add a Planner in the team.
This problem occurs normally when you work with Microsoft Graph API, in fact, it is exactly my case.

Microsoft Graph API: Cloning a team

Microsoft has provided several API endpoints about Teams:

Giuliano De Luca | Blog |

Naturally, this is a great addition in terms of capabilities because we are able to build solutions for many use cases.
Imagine for instance a self-service request, where an end user is able to request a new MS Teams by triggering automatically a provisioning process. Recently this was exactly the use case where I worked on.
I created an automatism by leveraging the MS Graph API in order to clone an existing team.
I would say that this is a common use case in every company where is possible reuse settings, apps, members, tabs and channel which is very comfortable for the owner avoiding loss of time with the first set up.


Let's jump into the problem.
In my scenario, the idea was to clone an existing team, add a couple of owners and finally clean up owners and members inherited from the cloned team, because, I remember you that a team cannot exists without an owner at least.
After that some teams were delivered, users reported me that they were not able to add new Planners.
I spent some time to search the cause until I read about the add owner endpoint on the official MS Graph API documentation:

Giuliano De Luca | Blog |

Currently, it seems like that add owner doesn't provide the same capabilities than add member, this explains the error "Failed to create the plan" due to insufficient privileges.


In order to solve this issue, I changed the logic flow of my process.
In fact, by consuming the "add member" and then "add owner" endpoint It has allowed me to overcome this problem.
It is interesting to note that the user is both a member and owner of the team.
This is not understandable by the Microsoft Teams UI (which display the user only as owner) but you can see it by consuming the endpoints to collect members and owners of the O365 group.


As you can see from a reply to my tweet Microsoft is working to fill the gap:

Giuliano De Luca | Blog |

Recently Microsoft has released in beta version a new REST endpoint to create a new team based on a template.
Check it out below to go deeper:

Techcommunity article