Did you ever want to link to the Notebook or the Planner associated with a specific Office 365 Group? The Microsoft Teams team maybe?
I've had to create multiple custom SharePoint Framework (SPFx) web parts and extensions linking to one or more of these workloads, and this workaround saved me a lot of time and execution resources but it seems that not much has been written about it yet... Time to change that!
I used to load the correct URLs using Microsoft Graph but this method is much easier! Assuming the code runs on a group-connected SharePoint site, it's as simple as using the URL template:
You have to replace
<siteurl> with the URL to your Group-connected SharePoint team site, and replace
<target> with something from the following table:
|Microsoft Team team||team|
This only works if you already know the URL of the SharePoint site associated to the Office 365 Group. If you don't know the URL but you do know the root SharePoint URL (like
https://contoso.sharepoint.com) and the id of the Office 365 Group, you can achieve the same result using the following URL template: