Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
9338e5c2
Commit
9338e5c2
authored
Oct 30, 2018
by
Siddharth Bulia
Committed by
Greg Messner
Oct 29, 2018
Browse files
Added getClosedByMergeRequests() methods. (#264) (#265)
parent
0e99bac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/IssuesApi.java
View file @
9338e5c2
...
...
@@ -34,6 +34,7 @@ import org.gitlab4j.api.GitLabApi.ApiVersion;
import
org.gitlab4j.api.models.Duration
;
import
org.gitlab4j.api.models.Issue
;
import
org.gitlab4j.api.models.IssueFilter
;
import
org.gitlab4j.api.models.MergeRequest
;
import
org.gitlab4j.api.models.TimeStats
;
import
org.gitlab4j.api.utils.DurationUtils
;
...
...
@@ -621,4 +622,52 @@ public class IssuesApi extends AbstractApi implements Constants {
return
(
GitLabApi
.
createOptionalFromException
(
glae
));
}
}
/**
* Get list containing all the merge requests that will close issue when merged.
*
* GET /projects/:id/issues/:issue_iid/closed_by
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the internal ID of a project's issue
* @return a List containing all the merge requests what will close the issue when merged.
* @throws GitLabApiException if any exception occurs
*/
public
List
<
MergeRequest
>
getClosedByMergeRequests
(
Object
projectIdOrPath
,
Integer
issueIid
)
throws
GitLabApiException
{
return
(
getClosedByMergeRequests
(
projectIdOrPath
,
issueIid
,
1
,
getDefaultPerPage
()));
}
/**
* Get list containing all the merge requests that will close issue when merged.
*
* GET /projects/:id/issues/:issue_iid/closed_by
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the internal ID of a project's issue
* @param page the page to get
* @param perPage the number of issues per page
* @return a List containing all the merge requests what will close the issue when merged.
* @throws GitLabApiException if any exception occurs
*/
public
List
<
MergeRequest
>
getClosedByMergeRequests
(
Object
projectIdOrPath
,
Integer
issueIid
,
int
page
,
int
perPage
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
page
,
perPage
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"closed_by"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
MergeRequest
>>()
{
}));
}
/**
* Get a Pager containing all the merge requests that will close issue when merged.
*
* GET /projects/:id/issues/:issue_iid/closed_by
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param issueIid the internal ID of a project's issue
* @param itemsPerPage the number of Issue instances that will be fetched per page
* @return a Pager containing all the issues that would be closed by merging the provided merge request
* @throws GitLabApiException if any exception occurs
*/
public
Pager
<
MergeRequest
>
getClosedByMergeRequests
(
Object
projectIdOrPath
,
Integer
issueIid
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
new
Pager
<
MergeRequest
>(
this
,
MergeRequest
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"closed_by"
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment