import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# planner bucket set

Updates a Microsoft Planner bucket

## Usage

```sh
m365 planner bucket set [options]
```

## Options

```md definition-list
`-i, --id [id]`
: ID of the bucket. Specify either `id` or `name` but not both.

`-n, --name [name]`
: Name of the bucket. Specify either `id` or `name` but not both.

`--planId [planId]`
: ID of the plan to update the bucket of. Specify either `planId`, `planTitle`, or `rosterId` but not multiple when using `name`.

`--planTitle [planTitle]`
: Title of the plan to update the bucket of. Specify either `planId`, `planTitle`, or `rosterId` but not multiple when using `name`. Always use in combination with either `ownerGroupId` or `ownerGroupName`. 

`--rosterId [rosterId]`
: ID of the Planner Roster. Specify either `planId`, `planTitle`, or `rosterId` but not multiple when using `name`.

`--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`.

`--newName [newName]`
: New name of the bucket.

`--orderHint [orderHint]`
: Hint used to order items of this type in a list view. The format is defined as outlined [here](https://learn.microsoft.com/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0).
```

<Global />

## Remarks

:::warning

When using `rosterId`, the command is based on an API that is currently in preview and is subject to change once the API reached general availability.

:::

## Permissions

<Tabs>
  <TabItem value="Delegated">

  | Resource        | Permissions                           |
  |-----------------|---------------------------------------|
  | Microsoft Graph | Tasks.ReadWrite, GroupMember.Read.All |

  </TabItem>
  <TabItem value="Application">

  | Resource        | Permissions                               |
  |-----------------|-------------------------------------------|
  | Microsoft Graph | Tasks.ReadWrite.All, GroupMember.Read.All |

  </TabItem>
</Tabs>

## Examples

Updates the Microsoft Planner bucket by its ID

```sh
m365 planner bucket set --id "vncYUXCRBke28qMLB-d4xJcACtNz" --newName "New bucket name"
```

Updates the Microsoft Planner bucket with a given name based on its plan title and owner group name

```sh
m365 planner bucket set --name "My Bucket" --planTitle "My Plan" --ownerGroupName "My Group" --newName "New bucket name"
```

Updates the Microsoft Planner bucket with a given name based on its plan title and owner group ID

```sh
m365 planner bucket set --name "My Bucket" --planTitle "My Plan" --ownerGroupId 00000000-0000-0000-0000-000000000000 --newName "New bucket name"
```

Updates the Microsoft Planner bucket with a given name based on its Roster ID

```sh
m365 planner bucket set --name "My Bucket" --rosterId "RuY-PSpdw02drevnYDTCJpgAEfoI" --newName "New bucket name"
```

## Response

The command won't return a response on success.
