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

# planner bucket get

Gets the Microsoft Planner bucket in a plan

## Usage

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

## Options

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

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

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

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

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

<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.Read, GroupMember.Read.All |

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

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

  </TabItem>
</Tabs>

## Examples

Gets the specified Microsoft Planner bucket 

```sh
m365 planner bucket get --id "5h1uuYFk4kKQ0hfoTUkRLpgALtYi"
```

Gets the Microsoft Planner bucket based on its plan ID

```sh
m365 planner bucket get --name "Planner Bucket A" --planId "xqQg5FS2LkCp935s-FIFm2QAFkHM"
```

Gets the Microsoft Planner bucket based on its plan title and owner group name

```sh
m365 planner bucket get --name "Planner Bucket A" --planTitle "My Plan" --ownerGroupName "My Group"
```

Gets the Microsoft Planner bucket based on its plan title and owner group ID

```sh
m365 planner bucket get --name "Planner Bucket A" --planTitle "My Plan" --ownerGroupId "ee0f40fc-b2f7-45c7-b62d-11b90dd2ea8e"
```

Gets the Microsoft Planner bucket based on its Roster ID

```sh
m365 planner bucket get --name "Planner Bucket A" --rosterId "RuY-PSpdw02drevnYDTCJpgAEfoI"
```

## Response

<Tabs>
  <TabItem value="JSON">

  ```json
  {
    "name": "My Planner Bucket",
    "planId": "xqQg5FS2LkCp935s-FIFm2QAFkHM",
    "orderHint": "8585363889524958496",
    "id": "ttEB_Uj690STdR3GC1MIDZgANq1U"
  }
  ```

  </TabItem>
  <TabItem value="Text">

  ```text
  id       : ttEB_Uj690STdR3GC1MIDZgANq1U
  name     : My Planner Bucket
  orderHint: 8585363889524958496
  planId   : xqQg5FS2LkCp935s-FIFm2QAFkHM
  ```

  </TabItem>
  <TabItem value="CSV">

  ```csv
  id,name,planId,orderHint
  ttEB_Uj690STdR3GC1MIDZgANq1U,My Planner Bucket,xqQg5FS2LkCp935s-FIFm2QAFkHM,8585363889524958496
  ```

  </TabItem>
  <TabItem value="Markdown">

  ```md
  # planner bucket get --id "ttEB_Uj690STdR3GC1MIDZgANq1U"

  Date: 27/12/2022

  ## My Planner Bucket (ttEB_Uj690STdR3GC1MIDZgANq1U)

  Property | Value
  ---------|-------
  name | My Planner Bucket
  planId | xqQg5FS2LkCp935s-FIFm2QAFkHM
  orderHint | 8585363889524958496
  id | ttEB_Uj690STdR3GC1MIDZgANq1U
  ```

  </TabItem>
</Tabs>

