Files
team/server/cmd/mmctl/docs/mmctl_team_rename.rst
32d6add42f [MM-62445] Allow changing a team's name (slug) via mmctl team rename (#37169)
* Allow renaming a team's name (slug) via the team update API

The team update API path is sanitized and intentionally ignores the
Name field, so the previously orphaned RenameTeam app method (which no
longer persisted the Name change) is now wired into the updateTeam
handler and fixed to persist the new slug and emit a team update event.

Co-authored-by: mattermost-code <[email protected]>

* Add --name flag to mmctl team rename

Allow changing a team's name (the URL slug) via mmctl team rename. The
command now accepts --name and/or --display-name, and at least one must
be provided.

Co-authored-by: mattermost-code <[email protected]>

* Polish team rename error message and fix err shadow

Co-authored-by: mattermost-code <[email protected]>

* Strengthen team rename tests

Add regression coverage that the rename path cannot leak non-renamable
fields (email/type), that invalid and duplicate renames leave the slug
unchanged, and a unit case for renaming name and display name together.

Co-authored-by: mattermost-code <[email protected]>

* Address PR feedback: 1 answered, 1 resolved, 0 declined

* Remove unused App.RenameTeam method

The rename path now goes through App.UpdateTeam (via the team update API
and mmctl), leaving App.RenameTeam orphaned. Remove it and update the
name-occupied error source label to UpdateTeam.

* Return non-not-found errors from team name lookup

Only treat store.ErrNotFound from GetByName as an available slug; any
other lookup failure is now returned instead of silently allowing the
rename to proceed. Addresses CodeRabbit review feedback on the team
update path.

* Remove low-value TestUpdateTeamNameLookupError per review feedback

---------

Co-authored-by: mattermost-code <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-10 09:11:17 +02:00

54 lines
1.4 KiB
ReStructuredText

.. _mmctl_team_rename:
mmctl team rename
-----------------
Rename team
Synopsis
~~~~~~~~
Rename an existing team. The team's name (the URL slug) and/or its display name can be changed.
::
mmctl team rename [team] [flags]
Examples
~~~~~~~~
::
team rename old-team --name new-team --display-name 'New Display Name'
Options
~~~~~~~
::
--display-name string New team display name
-h, --help help for rename
--name string New team name (the URL slug)
Options inherited from parent commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
--config string path to the configuration file (default "$XDG_CONFIG_HOME/mmctl/config")
--disable-pager disables paged output
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--insecure-tls-version allows to use TLS versions 1.0 and 1.1
--json the output format will be in json format
--local allows communicating with the server through a unix socket
--quiet prevent mmctl to generate output for the commands
--strict will only run commands if the mmctl version matches the server one
--suppress-warnings disables printing warning messages
SEE ALSO
~~~~~~~~
* `mmctl team <mmctl_team.rst>`_ - Management of teams