Skip to main content

planner task add

Adds a new Microsoft Planner task

Usage

m365 planner task add [options]

Options

-t, --title <title>

Title of the task to add.

--planId [planId]

ID of the plan to which the task belongs. Specify either planId or planTitle but not both.

--planTitle [planTitle]

Title of the plan to which the task belongs. Specify either planId or planTitle but not both.

--ownerGroupId [ownerGroupId]

ID of the group to which the plan belongs. Specify ownerGroupId or ownerGroupName when using planTitle.

--ownerGroupName [ownerGroupName]

Name of the group to which the plan belongs. Specify ownerGroupId or ownerGroupName when using planTitle.

--bucketId [bucketId]

ID of the bucket to which the task belongs. The bucket needs to exist in the selected plan. Specify either bucketId or bucketName but not both.

--bucketName [bucketName]

Name of the bucket to which the task belongs. The bucket needs to exist in the selected plan. Specify either bucketId or bucketName but not both.

--startDateTime [startDateTime]

The date and time when the task started. This should be defined as a valid ISO 8601 string. 2021-12-16T18:28:48.6964197Z

--dueDateTime [dueDateTime]

The date and time when the task is due. This should be defined as a valid ISO 8601 string. 2021-12-16T18:28:48.6964197Z

--percentComplete [percentComplete]

Percentage of task completion. Number between 0 and 100.

--assignedToUserIds [assignedToUserIds]

The comma-separated IDs of the assignees the task is assigned to. Specify either assignedToUserIds or assignedToUserNames but not both.

--assignedToUserNames [assignedToUserNames]

The comma-separated UPNs of the assignees the task is assigned to. Specify either assignedToUserIds or assignedToUserNames but not both.

--assigneePriority [assigneePriority]

Hint used to order items of this type in a list view. The format is defined as outlined here.

--description [description]

Description of the task.

--appliedCategories [appliedCategories]

Comma-separated categories that should be added to the task. The possible options are: category1, category2, category3, category4, category5 and/or category6. Additional info defined here.

--previewType [previewType]

This sets the type of preview that shows up on the task. The possible values are: automatic, noPreview, checklist, description, reference. When set to automatic the displayed preview is chosen by the app viewing the task. Default automatic.

--orderHint [orderHint]

Hint used to order items of this type in a list view. The format is defined as outlined here.

--priority [priority]

Priority of the task: Urgent, Important, Medium, Low. Or an integer between 0 and 10 (check remarks section for more info). Default value is Medium.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

When you specify the value for percentComplete, consider the following:

  • when set to 0, the task is considered Not started
  • when set between 1 and 99, the task is considered In progress
  • when set to 100, the task is considered Completed

When you specify an integer value for priority, consider the following:

  • values 0 and 1 are interpreted as Urgent
  • values 2, 3 and 4 are interpreted as Important
  • values 5, 6 and 7 are interpreted as Medium
  • values 8, 9 and 10 are interpreted as Low

When using description with a multiple lines value, use the new line character of the shell you are using to indicate line breaks. For PowerShell this is `n. For Zsh or Bash use \n with a $ in front. E.g. $"Line 1\nLine 2".

Examples

Adds a Microsoft Planner task with the name My Planner Task for plan with the ID 8QZEH7b3wkSbGQobscsM5gADCBa and for the bucket with the ID IK8tuFTwQEa5vTonM7ZMRZgAKdna

m365 planner task add --title "My Planner Task" --planId "8QZEH7b3wkSbGQobscsM5gADCBa" --bucketId "IK8tuFTwQEa5vTonM7ZMRZgAKdna"

Adds a Completed Microsoft Planner task with the name My Planner Task for plan with the title My Planner Plan owned by group My Planner Group and for the bucket with the ID IK8tuFTwQEa5vTonM7ZMRZgAKdna

m365 planner task add --title "My Planner task" --planTitle "My Planner Plan" --ownerGroupName "My Planner Group" --bucketId "IK8tuFTwQEa5vTonM7ZMRZgAKdna" --percentComplete 100

Adds a Microsoft Planner task with the name My Planner Task for plan with the ID 8QZEH7b3wkbGQobscsM5gADCBa and for the bucket with the ID IK8tuFTwQEa5vTonM7ZMRZgAKdna. The new task will be assigned to several users and receive a due date for 2021-12-16

m365 planner task add --title "My Planner Task" --planId "8QZEH7b3wkSbGQobscsM5gADCBa" --bucketId "IK8tuFTwQEa5vTonM7ZMRZgAKdna" --assignedToUserNames "Allan.Carroll@contoso.com,Ida.Stevens@contoso.com" --dueDateTime "2021-12-16"

Adds a Microsoft Planner task with the name My Planner Task for plan with the ID 8QZEH7b3wkbGQobscsM5gADCBa and for the bucket with the ID IK8tuFTwQEa5vTonM7ZMRZgAKdna. The new task will be assigned to several users who will appear first with the asssignee priority ' !'

m365 planner task add --title "My Planner Task" --planId "8QZEH7b3wkSbGQobscsM5gADCBa" --bucketId "IK8tuFTwQEa5vTonM7ZMRZgAKdna" --assignedToUserNames "Allan.Carroll@contoso.com,Ida.Stevens@contoso.com" --asssigneePriority ' !'

Adds a Microsoft Planner task with the name My Planner Task for plan with the ID 8QZEH7b3wkbGQobscsM5gADCBa and for the bucket with the ID IK8tuFTwQEa5vTonM7ZMRZgAKdna. The new task will receive the categories category1,category3 and get a preview with the type noPreview

m365 planner task add --title "My Planner Task" --planId "8QZEH7b3wkSbGQobscsM5gADCBa" --bucketId "IK8tuFTwQEa5vTonM7ZMRZgAKdna" --appliedCategories "category1,category3" --previewType "noPreview"

Response

Standard response

{
"planId": "oUHpnKBFekqfGE_PS6GGUZcAFY7b",
"bucketId": "vncYUXCRBke28qMLB-d4xJcACtNz",
"title": "Important task",
"orderHint": "8585269241124027581",
"assigneePriority": "",
"percentComplete": 50,
"startDateTime": "2023-01-20T00:00:00Z",
"createdDateTime": "2023-01-25T21:39:33.0748226Z",
"dueDateTime": "2023-02-15T00:00:00Z",
"hasDescription": false,
"previewType": "automatic",
"completedDateTime": null,
"completedBy": null,
"referenceCount": 0,
"checklistItemCount": 0,
"activeChecklistItemCount": 0,
"conversationThreadId": null,
"priority": 5,
"id": "D-ys8Ef4kEuwYG4r68Um3pcAAe9M",
"createdBy": {
"user": {
"displayName": null,
"id": "b2091e18-7882-4efe-b7d1-90703f5a5c65"
},
"application": {
"displayName": null,
"id": "31359c7f-bd7e-475c-86db-fdb8c937548e"
}
},
"appliedCategories": {},
"assignments": {}
}

description, previewType response

{
"planId": "oUHpnKBFekqfGE_PS6GGUZcAFY7b",
"bucketId": "vncYUXCRBke28qMLB-d4xJcACtNz",
"title": "Important task",
"orderHint": "8585269241124027581",
"assigneePriority": "",
"percentComplete": 50,
"startDateTime": "2023-01-20T00:00:00Z",
"createdDateTime": "2023-01-25T21:39:33.0748226Z",
"dueDateTime": "2023-02-15T00:00:00Z",
"hasDescription": true,
"previewType": "automatic",
"completedDateTime": null,
"completedBy": null,
"referenceCount": 0,
"checklistItemCount": 0,
"activeChecklistItemCount": 0,
"conversationThreadId": null,
"priority": 5,
"id": "D-ys8Ef4kEuwYG4r68Um3pcAAe9M",
"createdBy": {
"user": {
"displayName": null,
"id": "b2091e18-7882-4efe-b7d1-90703f5a5c65"
},
"application": {
"displayName": null,
"id": "31359c7f-bd7e-475c-86db-fdb8c937548e"
}
},
"appliedCategories": {},
"assignments": {},
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"references": {},
"checklist": {}
}
CTRL + M