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
ce81b13b
Commit
ce81b13b
authored
Oct 19, 2019
by
Thomas Oster
Committed by
Greg Messner
Oct 19, 2019
Browse files
Add Group Issue API support (#452)
parent
a6b0b431
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/IssuesApi.java
View file @
ce81b13b
...
@@ -265,6 +265,40 @@ public class IssuesApi extends AbstractApi implements Constants {
...
@@ -265,6 +265,40 @@ public class IssuesApi extends AbstractApi implements Constants {
return
(
getIssues
(
filter
,
getDefaultPerPage
()).
stream
());
return
(
getIssues
(
filter
,
getDefaultPerPage
()).
stream
());
}
}
/**
* Get a list of groups's issues.
*
* <pre><code>GitLab Endpoint: GET /groups/:id/issues</code></pre>
*
* @param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings.
* @param itemsPerPage the number of Project instances that will be fetched per page.
* @return the Pager of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public
Pager
<
Issue
>
getGroupIssues
(
Object
groupIdOrPath
,
IssueFilter
filter
,
int
itemsPerPage
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
filter
.
getQueryParams
();
return
(
new
Pager
<
Issue
>(
this
,
Issue
.
class
,
itemsPerPage
,
formData
.
asMap
(),
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"issues"
));
}
/**
* Get a list of project's issues.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/issues</code></pre>
*
* @param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings.
* @param page the page to get.
* @param perPage the number of projects per page.
* @return the list of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Issue
>
getGroupIssues
(
Object
groupIdOrPath
,
IssueFilter
filter
,
int
page
,
int
perPage
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
filter
.
getQueryParams
(
page
,
perPage
);
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"issues"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Issue
>>()
{}));
}
/**
/**
* Get a single project issue.
* Get a single project issue.
*
*
...
...
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