Forum Discussion
Create Tab call in Teams call for MS Planner showing all Tasks, not just from referenced Planner
Hi all,
we are struggling with an issue POSTing to the "Add tab to channel" endpoint using Graph API.
The calls succeed, but the tab instead of showing tasks from the referenced Plan shows "My Tasks" and therefore all tasks assigned to the user looking at the tab. We have tried to find any reference of this behaviour, but were unable to find a solution. Any ideas? Body below:
POST /teams/{team-id}/channels/{channel-id}/tabs
{
"email address removed for privacy reasons": "https://graph.microsoft.com/beta/appCatalogs/teamsApps/com.microsoft.teamspace.tab.planner",
"entityId": "tt.c_<channelId>_p_<planId>",
"contentUrl": "https://tasks.teams.microsoft.com/teamsui/{tid}/Home/PlannerFrame?page=7&auth_pvr=OrgId&auth_upn={userPrincipalName}&groupId={groupId}&planId=<planId>&channelId={channelId}&entityId={entityId}&tid={tid}&userObjectId={userObjectId}&subEntityId={subEntityId}&sessionId={sessionId}&theme={theme}&mkt={locale}&ringId={ringId}&PlannerRouteHint={tid}&tabVersion=20200228.1_s",
"websiteUrl": "https://tasks.office.com/b3f4f7c2-72ce-4192-aba4-d6c7719b5766/Home/PlanViews/<planId>?Type=PlanLink&Channel=TeamsTab",
"removeUrl": "https://tasks.teams.microsoft.com/teamsui/{tid}/Home/PlannerFrame?page=13&auth_pvr=OrgId&auth_upn={userPrincipalName}&groupId={groupId}&planId=<planId>&channelId={channelId}&entityId={entityId}&tid={tid}&userObjectId={userObjectId}&subEntityId={subEntityId}&sessionId={sessionId}&theme={theme}&mkt={locale}&ringId={ringId}&PlannerRouteHint={tid}&tabVersion=20200228.1_s"
}
<planId> and <channelId> are filled in with the actual plan and channel id.
1 Reply
- BenFromAkitaCopper Contributor
I managed to get this working with the below request body:
{ "displayName": "<TABNAME>", "email address removed for privacy reasons" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/com.microsoft.teamspace.tab.planner", "configuration": { "entityId": "tt.c_<CHANNELID>_p_<PLANID>_h_1717017031119", "contentUrl": "https://tasks.teams.microsoft.com/teamsui/{tid}/Home/PlannerFrame?page=7&auth_pvr=OrgId&auth_upn={userPrincipalName}&groupId={groupId}&planId=<PLANID>&channelId={channelId}&entityId={entityId}&tid={tid}&userObjectId={userObjectId}&subEntityId={subEntityId}&sessionId={sessionId}&theme={theme}&mkt={locale}&ringId={ringId}&PlannerRouteHint={tid}&tabVersion=20200228.1_s" } }
I couldn't find reference to what the _h_1717017031119 is, but that as a static value seems to work for our use case. To get this, I used the get Tab endpoint to check a tab that we manually configured in Teams to the correct Planner.
GET /teams/{team-id}/channels/{channel-id}/tabs/{tab-id}
Hope this helps!