Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Last known ETag value for the plannerTask to be updated. Required.
Request body
In the request body, supply only the values for properties that should be updated. Existing properties that aren't included in the request body maintains their previous values or be recalculated based on changes to other property values.
The following table specifies the properties that can be updated.
Bucket ID to which the task belongs. The bucket needs to be in the plan that the task is in. The value is 28 characters long and case-sensitive. Format validation is done on the service.
conversationThreadId
String
Thread ID of the conversation on the task. This is the ID of the conversation thread object created in the group.
dueDateTime
DateTimeOffset
Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z
Priority of the task. The valid range of values is between 0 and 10, with the increasing value being lower priority (0 has the highest priority and 10 has the lowest priority). Currently, Planner interprets values 0 and 1 as "urgent", 2, 3 and 4 as "important", 5, 6, and 7 as "medium", and 8, 9, and 10 as "low". Additionally, Planner sets the value 1 for "urgent", 3 for "important", 5 for "medium", and 9 for "low".
percentComplete
Int32
Percentage of task completion. When set to 100, the task is considered completed.
startDateTime
DateTimeOffset
Date and time at which the task starts. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
title
String
Title of the task.
Note
For Project tasks that are replicated to Planner, only the percentComplete property can be updated.
Response
If successful, this method returns a 204 No Content response code and an empty content. If the request specifies the Prefer header with a return=representation preference, then this method returns a 200 OK response code and an updated plannerTask object in the response body.
This method can return any of the HTTP status codes. The most common errors that apps should handle for this method are the 400, 403, 404, 409, and 412 responses. For more information about these errors, see Common Planner error conditions.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new PlannerTask
{
Assignments = new PlannerAssignments
{
AdditionalData = new Dictionary<string, object>
{
{
"fbab97d0-4932-4511-b675-204639209557" , new PlannerAssignment
{
OdataType = "#microsoft.graph.plannerAssignment",
OrderHint = "N9917 U2883!",
}
},
},
},
AppliedCategories = new PlannerAppliedCategories
{
AdditionalData = new Dictionary<string, object>
{
{
"category3" , true
},
{
"category4" , false
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Planner.Tasks["{plannerTask-id}"].PatchAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "return=representation");
requestConfiguration.Headers.Add("If-Match", "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"");
});
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
PlannerTask plannerTask = new PlannerTask();
PlannerAssignments assignments = new PlannerAssignments();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
PlannerAssignment fbab97d049324511B675204639209557 = new PlannerAssignment();
fbab97d049324511B675204639209557.setOdataType("#microsoft.graph.plannerAssignment");
fbab97d049324511B675204639209557.setOrderHint("N9917 U2883!");
additionalData.put("fbab97d0-4932-4511-b675-204639209557", fbab97d049324511B675204639209557);
assignments.setAdditionalData(additionalData);
plannerTask.setAssignments(assignments);
PlannerAppliedCategories appliedCategories = new PlannerAppliedCategories();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("category3", true);
additionalData1.put("category4", false);
appliedCategories.setAdditionalData(additionalData1);
plannerTask.setAppliedCategories(appliedCategories);
PlannerTask result = graphClient.planner().tasks().byPlannerTaskId("{plannerTask-id}").patch(plannerTask, requestConfiguration -> {
requestConfiguration.headers.add("Prefer", "return=representation");
requestConfiguration.headers.add("If-Match", "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"");
});