Skip to content

Commit beb7db0

Browse files
committed
Add Issue related Merge Request fix #1144
1 parent dff8509 commit beb7db0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,4 +1326,24 @@ 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+
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
1333+
* @param issueIid the IID of the issue to get the related merge requests for
1334+
* @return a List containing all related merge requests for the specified issue
1335+
* @throws GitLabApiException if any exception occurs
1336+
*/
1337+
public List<MergeRequest> getIssueRelatedMergeRequests(Object projectIdOrPath, Long issueIid)
1338+
throws GitLabApiException {
1339+
Response response = get(
1340+
Response.Status.OK,
1341+
null,
1342+
"projects",
1343+
getProjectIdOrPath(projectIdOrPath),
1344+
"issues",
1345+
issueIid,
1346+
"related_merge_requests");
1347+
return (response.readEntity(new GenericType<List<MergeRequest>>() {}));
1348+
}
13291349
}

0 commit comments

Comments
 (0)