Skip to content

Enhancement: Support Planner Rosters for planner plan add #4400

@milanholemans

Description

@milanholemans

Context

Right now our Planner commands can only work with plans contained in groups. Let's extend them to use Planner Rosters as well.

Options to add

Option Description
--rosterId [rosterId] ID of the Planner Roster. Specify either ownerGroupId, ownerGroupName or rosterId.

Docs

We could add the following to the docs:

Hint: Unlike for groups, a Planner Roster can contain only 1 plan.

(if you add more plans, you get a pretty vague error).

Extra

Since you can only add 1 plan to a Roster and Graph returns a pretty vague error (You do not have the required permissions to access this item, or the item may not exist.) when you try to add more, let's catch this error and throw our own error which is clearer.

API request

https://learn.microsoft.com/en-us/graph/api/planner-post-plans?view=graph-rest-1.0&tabs=http
However we have to use Graph beta to create a Roster, we can use v1.0 to add a plan to it.

The Graph API request is slightly modified from the one we are using now.
I found the following requests work the best:

Add plan to group

POST https://graph.microsoft.com/v1.0/planner/plans
Content-type: application/json

{
  "container": {
    "url": "https://graph.microsoft.com/v1.0/groups/ebf3b108-5234-4e22-b93d-656d7dae5874"
  },
  "title": "title-value"
}

Add plan to Roster

POST https://graph.microsoft.com/v1.0/planner/plans
Content-type: application/json

{
  "container": {
    "url": "https://graph.microsoft.com/v1.0/planner/rosters/tYqYlNd6eECmsNhN_fcq85cAGAnd"
  },
  "title": "title-value"
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions