[4.9.x] fix: filter user groups by env scope in query parameter #14016
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automatic copy of pull request #13890 done by Mergify.
Issue
https://gravitee.atlassian.net/browse/APIM-10981
Description
The UserResource.getUserGroups endpoint now correctly filters groups by environment when the 'q' query parameter is provided with valid environmentId.
Sample:
management/organizations/{orgID}/users/{userID}/groups?q={envID} => filters data based on envID
management/organizations/{orgID}/users/{userID}/groups => provides full list of groups for the user
The issue was that old API is already deprecated GET management/organizations/{orgId}/environments/{envId}/users/{userId}/groups but if user wants to filter data based on the envId then there was no option to do so.
Changes:
Previously, the endpoint returned all organization groups and no option was available for end user to filter data based on environment id.
Screen.Recording.2025-11-02.at.12.19.35.PM.mov
Updated fix with QUERY PARAM:
Screen.Recording.2025-11-11.at.9.59.02.PM.mov
Additional context