# Update Task — Microsoft 365 Planner

> Updates a task in Microsoft 365 Planner. See the documentation

- Key: `microsoft_365_planner-update-task`
- Type: Action (Write)
- Version: 0.0.5
- App: Microsoft 365 Planner (`microsoft_365_planner`) — https://pipedream.com/apps/microsoft-365-planner.md
- This page (HTML): https://pipedream.com/apps/microsoft-365-planner/actions/update-task
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_365_planner/actions/update-task/update-task.mjs

## Description

Updates a task in Microsoft 365 Planner. [See the documentation](https://learn.microsoft.com/en-us/graph/api/plannertask-update?view=graph-rest-1.0&tabs=http)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `taskId` | `string` | Yes | Identifier of a user task Options are loaded from the connected account. |
| `title` | `string` | No | Title of the task |
| `priority` | `integer` | No | 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) |
| `percentComplete` | `integer` | No | Percentage of task completion. When set to 100, the task is considered completed. |
| `dueDateTime` | `string` | No | 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. |
| `startDateTime` | `string` | No | 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. |
| `orderHint` | `string` | No | Hint used to order items of this type in a list view. The format is defined in Using order hints in Planner. |
| `assigneePriority` | `string` | No | Hint used to order items of this type in a list view. The format is defined as outlined here. |
| `groupId` | `string` | No | The group container of the plan Options are loaded from the connected account. |
| `conversationThreadId` | `string` | No | Identifier of the conversation thread associated with the task. Options are loaded from the connected account. |
| `assignmentIds` | `string[]` | No | Array of assignee Ids Options are loaded from the connected account. |
| `planId` | `string` | No | Identifier of a plan Options are loaded from the connected account. |
| `bucketId` | `string` | No | Identifier of a bucket Options are loaded from the connected account. |
| `appliedCategories` | `string[]` | No | The categories to which the task has been applied. See applied Categories for possible values. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "microsoft_365_planner",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "microsoft_365_planner-update-task",
  arguments: {
    taskId: "User Task ID",
    title: "Title",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "microsoft_365_planner-update-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_365_planner: { authProvisionId: "apn_xxxxxxx" },
    taskId: "User Task ID",
    title: "Title",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "microsoft_365_planner-update-task",
    "configured_props": {
      "microsoft_365_planner": { "authProvisionId": "apn_xxxxxxx" },
      "taskId": "User Task ID",
      "title": "Title"
    }
  }'
```

---

- App: https://pipedream.com/apps/microsoft-365-planner.md · All apps: https://pipedream.com/apps
