Skip to content

Bug report: teams tab get command always returns duplicate team name error when using --teamName option #2930

@garrytrinder

Description

@garrytrinder

Description

I noticed this on the teams tab get command first when using the --teamName option, that the error message (shown below) was returned when only one team with that name exists in the tenant.

Error: Multiple Microsoft Teams teams with name <teamName> found: 380e81b3-dc8a-4e1c-b0df-20df6253e1fe,ad27b211-86f8-478a-86f3-8fa29d6fb634,bca28cf0-4604-45f6-9dd9-e3ceafe31478,a863cab9-d3dc-4025-b9f4-84a934408b9e

After inspecting the code, when --teamName is used in the command, the $filter parameter is used on the v1.0/me/joinedTeams endpoint, however this endpoint does not support any OData query parameters as described in the documentation, which results in all joinedTeams being returned, which causes the error to be thrown as more than one Team has been returned in the response.

The same implementation is used on the teams app list command, I suspect this will suffer the same issue as it also uses the same query, however I have not tested that command yet.

Steps to reproduce

Execute either teams tab get or teams app list using the --teamName option, providing the name of a team that does exist.

Expected results

No error should be thrown and the information returned for the team or apps listed in a given team.

Actual results

The error message Multiple Microsoft Teams teams with name error will be thrown.

Diagnostics

No response

CLI for Microsoft 365 version

v4.4.0-beta.1bd9aa9

nodejs version

v12.22.6

Operating system (environment)

Linux

Shell

bash

cli doctor

{
  "os": {
    "platform": "linux",
    "version": "#1 SMP Mon Nov 8 10:21:19 UTC 2021",
    "release": "5.10.76-linuxkit"
  },
  "cliVersion": "4.4.0-beta.1bd9aa9",
  "nodeVersion": "v12.22.6",
  "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
  "cliAadAppTenant": "common",
  "authMode": "DeviceCode",
  "cliEnvironment": "docker",
  "cliConfig": {},
  "roles": [],
  "scopes": [
    "AllSites.FullControl",
    "AppCatalog.ReadWrite.All",
    "Directory.AccessAsUser.All",
    "Directory.ReadWrite.All",
    "Group.ReadWrite.All",
    "IdentityProvider.ReadWrite.All",
    "Mail.Send",
    "Reports.Read.All",
    "Tasks.ReadWrite",
    "TermStore.ReadWrite.All",
    "User.Invite.All",
    "User.Read.All",
    "profile",
    "openid",
    "email"
  ]
}

Additional Info

List joinedTeams, Optional query parameters - https://docs.microsoft.com/en-us/graph/api/user-list-joinedteams?view=graph-rest-1.0&tabs=http#optional-query-parameters

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions