From beb7db02bcf9169421fc5c2b3db7597540ad24a4 Mon Sep 17 00:00:00 2001 From: Jean-Michel Leclercq Date: Sat, 4 Oct 2025 15:17:14 +0200 Subject: [PATCH 1/2] Add Issue related Merge Request fix #1144 --- .../main/java/org/gitlab4j/api/IssuesApi.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java index 452b967e..9ff7dafe 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java @@ -1326,4 +1326,24 @@ public Issue moveIssue(Object projectIdOrPath, Long issueIid, Object toProjectId "move"); return (response.readEntity(Issue.class)); } + + /** + * Get list of merge requests related to an issue. + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param issueIid the IID of the issue to get the related merge requests for + * @return a List containing all related merge requests for the specified issue + * @throws GitLabApiException if any exception occurs + */ + public List getIssueRelatedMergeRequests(Object projectIdOrPath, Long issueIid) + throws GitLabApiException { + Response response = get( + Response.Status.OK, + null, + "projects", + getProjectIdOrPath(projectIdOrPath), + "issues", + issueIid, + "related_merge_requests"); + return (response.readEntity(new GenericType>() {})); + } } From f09fa632ef40bcfab83b0a4f91a50fbfc368dfe6 Mon Sep 17 00:00:00 2001 From: Jean-Michel Leclercq Date: Sat, 4 Oct 2025 15:17:14 +0200 Subject: [PATCH 2/2] Add Issue related Merge Request fix #1144 --- gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java index 9ff7dafe..313d476a 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java @@ -1329,6 +1329,9 @@ public Issue moveIssue(Object projectIdOrPath, Long issueIid, Object toProjectId /** * Get list of merge requests related to an issue. + * + *
GitLab Endpoint: GET /projects/:id/issues/:issue_iid/related_merge_requests
+ * * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance * @param issueIid the IID of the issue to get the related merge requests for * @return a List containing all related merge requests for the specified issue