Group API shared_with_groups missing results

Hi,
I noticed some strange behaivor with the Group API

When I request a group details, shared_with_groups didn’t list all relations to others groups. I configured through UI many of them but API response don’t get all.

However if I try to recreate this missing relations through API, obviously, already exists
409 {message: Shared group The group has already been shared with this group}

Are there any consideration to this behaivor?

Thanks

1 Like

I have the same Problem.

I am using GitLab EE v18.3.2.

Situation:

I have the following Group structure:

  • Group1 (ID:1)
    • Group1.1 (ID:3)
      • Group1.1.1 (ID:6)
      • Group1.1.2 (ID:7)
    • Group1.2 (ID:4)
    • Group1.3 (ID:5)
      • Group1.3.1 (ID:8)
  • Group2 (ID:2)
    • Project1

I am the owner and administrator of all Groups. The Group2 has (besides me as owner) no direct members, but has invited the Groups: Group1.1.1, Group1.1.2 and Group1.3.1. The Groups Group1.1.1, Group1.1.2 and Group1.3.1 have all users as direct members.

Problem:

I need to know with what maximum role the invited groups have. (Basically the Group Members site in the UI)

The endpoint GET /groups/:id has the attribute shared_with_groups which should return a list of all groups this group has been invited to.

But when I call this Endpoint for the Groups: Group1.1.1, Group1.1.2 and Group1.3.1 I always get an empty list while the endpoint GET /groups/:id/groups/shared returns the Group Group2.

When I call the endpoint GET /groups/:id on the Groups: Group1.1 and Group1.3 it returns their subgroups (Group1.1.1, Group1.1.2 and Group1.3.1)

Is this behavior intentional? If Yes how can I get all groups and their maximum role shared with this group?