Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeRequest API add MergeRequestFilter withReviewer by ID OR by Username #1209

Closed
dstoianov opened this issue Dec 12, 2024 · 3 comments · Fixed by #1218
Closed

MergeRequest API add MergeRequestFilter withReviewer by ID OR by Username #1209

dstoianov opened this issue Dec 12, 2024 · 3 comments · Fixed by #1218

Comments

@dstoianov
Copy link

Hi there,

It would be nice to have in API method to find all MRs where user is one of the reviewers.

We already have a similar API but in this case, it is

Examples of existing API

MergeRequestFilter filter = new MergeRequestFilter();
filter.withoutReviewerId(123L);
//OR
filter.withoutReviewerUsername("ABC");

Desired API

MergeRequestFilter filter = new MergeRequestFilter();
filter.withReviewerId(123L);
//OR
filter.withReviewerUsername("ABC");

if it is already implemented, please share this method or how it is possible to find all MRs assigned to user/currentUser

Thank you
Denys

@dstoianov dstoianov changed the title MergeRequest API add MergeRequestFilter withReviewer by ID by or Username MergeRequest API add MergeRequestFilter withReviewer by ID OR by Username Dec 12, 2024
@jmini
Copy link
Collaborator

jmini commented Dec 13, 2024

Can you point to GitLab REST API documentation?

I didn't look into the details, but I think a pull-request can be created to add the missing methods.

@alexeybrod
Copy link

Can you point to GitLab REST API documentation?

https://docs.gitlab.com/ee/api/merge_requests.html

reviewer_id - Returns merge requests which have the user as a reviewer with the given user id. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. Mutually exclusive with reviewer_username.
reviewer_username - Returns merge requests which have the user as a reviewer with the given username. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. Mutually exclusive with reviewer_id.

Having filter.withoutReviewerId() but not filter.withReviewerId(), looks like it was accidentally missed in API implementation.

@jmini
Copy link
Collaborator

jmini commented Dec 24, 2024

Indeed. Feel free to send a pull-request

jmini added a commit to jmini/gitlab4j-api that referenced this issue Dec 24, 2024
@jmini jmini closed this as completed in 9c10f51 Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants