30DaysMSGraph – Day 21 – Use case: Create plans, buckets, and tasks in Planner

Brian T. Jackett

List of all posts in the #30DaysMSGraph series

-Today’s post written by Vincent Biret

In Day 20 we configured the base .Net Core console application to utilize the device code authentication flow.  Today we will continue with that path by extending this application to interact with Planner.

Introduction to Microsoft Planner

Microsoft Planner helps teams self-organize and getting started on new projects quickly by capturing tasks inside plans. Planner then provides the ability to track progress, have conversation and report status through different charts. Microsoft Planner is part of the Office 365 eco-system and its APIs are exposed through the Microsoft Graph. If you want to know more about the service itself I encourage you to look at the detailed description. Together we will learn today how we can leverage the API’s exposed by the Microsoft Graph to automate and/or integrate some aspects of Planner.

Plans

Plans are the starting point of Planner. They represent a logical container for Tasks, Settings and much more. Today, plans must be created under an Office 365 Group and a group can contain multiple plans. Users can create plans through Planner (tasks.office.com) and Microsoft Teams (when adding a tab). As a developer you can create new plans trough the planner/plans endpoint. Two key points to keep in mind: plans also dictate the security settings and the owner property of a plan must be set to the Group Id it is associated to.

Learn how to create plans in C# from today’s sample.

Buckets

Buckets are a logical container inside of a plan. They help users organize their tasks, either by steps, status, categories, ownership…it is up to the team of the plan to decide how to use those. They are represented in Planner as vertical column.

As a developer you can leverage the Microsoft Graph to create/update/delete these buckets. This proves helpful when you are trying to template your plans. Let us suppose you work for a consulting company that provides marketing services. And most of your advertisement campaigns projects follow the same patterns: some tasks belong to the designers, some tasks belong to the webmasters, some tasks belong to the community managers, some tasks to the printing floor…. You can perfectly imagine automate the provisioning of new projects and plans and include “default buckets” that make sense in your context. The buckets endpoint will help you achieve this and if you want to learn how to implement it in C#, you can look at the associated section of the code from today’s sample.

Tasks

Tasks represent…tasks, or body of work that need to be completed so the project can move forward. Thanks to the tasks endpoints of the Microsoft Graph you can create/read/update/delete tasks as well as all associated details. Details contain information like categories, progress status, assignees, a discussion space, the bucket it is in and much more.

If we take our “new projects provisioning” example again, you could perfectly imagine creating default tasks and assigning those automatically to dedicated people. Think about things every project include like “send bill for the month to the customer”, “schedule kickoff meeting” and so on…

If you want to learn more about how to create tasks for planner in C# you can consult today’s example.

Permissions

Currently, interactions with Planner require the Groups.Read.All or Groups.ReadWrite.All permission.  Today’s exercise will be writing data to Planner and thus you will need to assign the Groups.ReadWrite.All permission.  In addition we will be querying for users within the tenant so you will also need the User.ReadBasic.All permission.

Try it out

Getting started today with Planner APIs and capabilities by looking at the following sample and consulting the documentation.  Navigate to the dotnetcore-console-sample repo.  Do one (or both) of the following:

Day 21 repo link

  1. Clone the repo and configure the project in the Day 21 sub-folder.
  2. Follow the instructions in Day 21 sub-folder to build the project from scratch yourself.

If you run into any issues while building or configuring the project please create a new Issue on the repo.

 

Join us tomorrow as we work with Intune using Microsoft Graph requests in Day 22.

Feedback usabilla icon