Skip to content

Commit 1dc8497

Browse files
authored
Add Issue related Merge Request fix (#1292)
1 parent dff8509 commit 1dc8497

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

gitlab4j-api/src/main/java/org/gitlab4j/api/IssuesApi.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,4 +1326,27 @@ public Issue moveIssue(Object projectIdOrPath, Long issueIid, Object toProjectId
13261326
"move");
13271327
return (response.readEntity(Issue.class));
13281328
}
1329+
1330+
/**
1331+
* Get list of merge requests related to an issue.
1332+
*
1333+
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/related_merge_requests</code></pre>
1334+
*
1335+
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
1336+
* @param issueIid the IID of the issue to get the related merge requests for
1337+
* @return a List containing all related merge requests for the specified issue
1338+
* @throws GitLabApiException if any exception occurs
1339+
*/
1340+
public List<MergeRequest> getIssueRelatedMergeRequests(Object projectIdOrPath, Long issueIid)
1341+
throws GitLabApiException {
1342+
Response response = get(
1343+
Response.Status.OK,
1344+
null,
1345+
"projects",
1346+
getProjectIdOrPath(projectIdOrPath),
1347+
"issues",
1348+
issueIid,
1349+
"related_merge_requests");
1350+
return (response.readEntity(new GenericType<List<MergeRequest>>() {}));
1351+
}
13291352
}

0 commit comments

Comments
 (0)