From 90c80d6738bf53e0d75af2a1514106f07d5e3724 Mon Sep 17 00:00:00 2001 From: Mihai Doarna Date: Wed, 11 Jun 2025 10:02:20 +0300 Subject: [PATCH] Teams: Add support for updating externalId field (#106406) * add support for updating externalId field in teams * return external_uid in GetTeam() --- pkg/services/team/model.go | 11 ++++++----- pkg/services/team/teamimpl/store.go | 7 ++++--- public/api-enterprise-spec.json | 5 ++++- public/api-merged.json | 3 +++ public/openapi3.json | 3 +++ 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/pkg/services/team/model.go b/pkg/services/team/model.go index 268eeea2d72..eead8de614f 100644 --- a/pkg/services/team/model.go +++ b/pkg/services/team/model.go @@ -46,10 +46,11 @@ type CreateTeamCommand struct { } type UpdateTeamCommand struct { - ID int64 - Name string - Email string - OrgID int64 `json:"-"` + ID int64 + Name string + Email string + ExternalUID string + OrgID int64 `json:"-"` } type DeleteTeamCommand struct { @@ -98,7 +99,7 @@ type TeamDTO struct { OrgID int64 `json:"orgId" xorm:"org_id"` Name string `json:"name"` Email string `json:"email"` - ExternalUID string `json:"externalUID"` + ExternalUID string `json:"externalUID" xorm:"external_uid"` IsProvisioned bool `json:"isProvisioned"` AvatarURL string `json:"avatarUrl"` MemberCount int64 `json:"memberCount"` diff --git a/pkg/services/team/teamimpl/store.go b/pkg/services/team/teamimpl/store.go index 8a4b77a97f1..d7502c48fc2 100644 --- a/pkg/services/team/teamimpl/store.go +++ b/pkg/services/team/teamimpl/store.go @@ -111,9 +111,10 @@ func (ss *xormStore) Update(ctx context.Context, cmd *team.UpdateTeamCommand) er } t := team.Team{ - Name: cmd.Name, - Email: cmd.Email, - Updated: time.Now(), + Name: cmd.Name, + Email: cmd.Email, + ExternalUID: cmd.ExternalUID, + Updated: time.Now(), } sess.MustCols("email") diff --git a/public/api-enterprise-spec.json b/public/api-enterprise-spec.json index 568b7826c44..bad7ad32f3a 100644 --- a/public/api-enterprise-spec.json +++ b/public/api-enterprise-spec.json @@ -8666,6 +8666,9 @@ "Email": { "type": "string" }, + "ExternalUID": { + "type": "string" + }, "ID": { "type": "integer", "format": "int64" @@ -10647,4 +10650,4 @@ "name": "service_accounts" } ] -} +} \ No newline at end of file diff --git a/public/api-merged.json b/public/api-merged.json index 7b2a63632a9..624c147aaa1 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -22411,6 +22411,9 @@ "Email": { "type": "string" }, + "ExternalUID": { + "type": "string" + }, "ID": { "type": "integer", "format": "int64" diff --git a/public/openapi3.json b/public/openapi3.json index 1c59dd4fe75..b1273b6913c 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -12459,6 +12459,9 @@ "Email": { "type": "string" }, + "ExternalUID": { + "type": "string" + }, "ID": { "format": "int64", "type": "integer"