package org.gitlab4j.api; import java.util.Date; import java.util.List; import java.util.Optional; import java.util.stream.Stream; import javax.ws.rs.core.GenericType; import javax.ws.rs.core.Response; 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.IssueLink; import org.gitlab4j.api.models.IssuesStatistics; import org.gitlab4j.api.models.IssuesStatisticsFilter; import org.gitlab4j.api.models.MergeRequest; import org.gitlab4j.api.models.Participant; import org.gitlab4j.api.models.TimeStats; import org.gitlab4j.api.utils.DurationUtils; /** * This class provides an entry point to all the GitLab API Issue calls. * @see Issues API at GitLab * @see Issue Links API at GitLab * @see Issues Statistics API at GitLab */ public class IssuesApi extends AbstractApi implements Constants { public IssuesApi(GitLabApi gitLabApi) { super(gitLabApi); } /** * Get all issues the authenticated user has access to. Only returns issues created by the current user. * *
GitLab Endpoint: GET /issues
*
* @return a list of user's issues
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /issues
*
* @param page the page to get
* @param perPage the number of issues per page
* @return the list of issues in the specified range
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /issues
*r
* @param itemsPerPage the number of issues per page
* @return the Pager of issues in the specified range
* @throws GitLabApiException if any exception occurs
*/
public PagerGitLab Endpoint: GET /issues
*
* @return a Stream of user's issues
* @throws GitLabApiException if any exception occurs
*/
public StreamGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @return a list of project's issues
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param page the page to get
* @param perPage the number of issues per page
* @return the list of issues in the specified range
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param itemsPerPage the number of issues per page
* @return the Pager of issues in the specified range
* @throws GitLabApiException if any exception occurs
*/
public PagerGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @return a Stream of project's issues
* @throws GitLabApiException if any exception occurs
*/
public StreamGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings
* @return the list of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project 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 ListGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project 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 PagerGitLab Endpoint: GET /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings
* @return a Stream of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public StreamGitLab Endpoint: GET /issues
*
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings
* @return the list of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /issues
*
* @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 ListGitLab Endpoint: GET /issues
*
* @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 PagerGitLab Endpoint: GET /issues
*
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings
* @return the Stream of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public StreamGitLab Endpoint: GET /projects/:id/issues/:issue_iid
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return the specified Issue instance
* @throws GitLabApiException if any exception occurs
*/
public Issue getIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
}
/**
* Get a single project issue as an Optional instance.
*
* GitLab Endpoint: GET /projects/:id/issues/:issue_iid
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return the specified Issue as an Optional instance
*/
public OptionalGitLab Endpoint: POST /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param title the title of an issue, required
* @param description the description of an issue, optional
* @return an instance of Issue
* @throws GitLabApiException if any exception occurs
*/
public Issue createIssue(Object projectIdOrPath, String title, String description) throws GitLabApiException {
return (createIssue(projectIdOrPath, title, description, null, null, null, null, null, null, null, null));
}
/**
* Create an issue for the project.
*
* GitLab Endpoint: POST /projects/:id/issues
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param title the issue title of an issue, required
* @param description the description of an issue, optional
* @param confidential set the issue to be confidential, default is false, optional
* @param assigneeIds the IDs of the users to assign issue, optional
* @param milestoneId the ID of a milestone to assign issue, optional
* @param labels comma-separated label names for an issue, optional
* @param createdAt the date the issue was created at, optional
* @param dueDate the due date, optional
* @param mergeRequestToResolveId the IID of a merge request in which to resolve all issues. This will fill the issue with a default
* description and mark all discussions as resolved. When passing a description or title, these values will take precedence over the default values. Optional
* @param discussionToResolveId the ID of a discussion to resolve. This will fill in the issue with a default description and mark the discussion as resolved.
* Use in combination with merge_request_to_resolve_discussions_of. Optional
* @return an instance of Issue
* @throws GitLabApiException if any exception occurs
*/
public Issue createIssue(Object projectIdOrPath, String title, String description, Boolean confidential, ListGitLab Endpoint: PUT /projects/:id/issues/:issue_iid
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param issueIid the issue IID to update, required
* @return an instance of the updated Issue
* @throws GitLabApiException if any exception occurs
*/
public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
GitLabApiForm formData = new GitLabApiForm().withParam("state_event", StateEvent.CLOSE);
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
}
/**
* Updates an existing project issue. This call can also be used to mark an issue as closed.
*
* GitLab Endpoint: PUT /projects/:id/issues/:issue_iid
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param issueIid the issue IID to update, required
* @param title the title of an issue, optional
* @param description the description of an issue, optional
* @param confidential set the issue to be confidential, default is false, optional
* @param assigneeIds the IDs of the users to assign issue, optional
* @param milestoneId the ID of a milestone to assign issue, optional
* @param labels comma-separated label names for an issue, optional
* @param stateEvent the state event of an issue. Set close to close the issue and reopen to reopen it, optional
* @param updatedAt sets the updated date, requires admin or project owner rights, optional
* @param dueDate the due date, optional
* @return an instance of the updated Issue
* @throws GitLabApiException if any exception occurs
*/
public Issue updateIssue(Object projectIdOrPath, Integer issueIid, String title, String description, Boolean confidential, ListGitLab Endpoint: DELETE /projects/:id/issues/:issue_iid
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param issueIid the internal ID of a project's issue
* @throws GitLabApiException if any exception occurs
*/
public void deleteIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
}
/**
* Sets an estimated time of work in this issue
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/time_estimate
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param issueIid the internal ID of a project's issue
* @param duration estimated time in seconds
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats estimateTime(Object projectIdOrPath, Integer issueIid, int duration) throws GitLabApiException {
return (estimateTime(projectIdOrPath, issueIid, new Duration(duration)));
}
/**
* Sets an estimated time of work in this issue
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/time_estimate
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param issueIid the internal ID of a project's issue
* @param duration Human readable format, e.g. 3h30m
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats estimateTime(Object projectIdOrPath, Integer issueIid, String duration) throws GitLabApiException {
return (estimateTime(projectIdOrPath, issueIid, new Duration(duration)));
}
/**
* Sets an estimated time of work in this issue
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/time_estimate
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @param duration set the estimate of time to this duration
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats estimateTime(Object projectIdOrPath, Integer issueIid, Duration duration) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
String durationString = (duration != null ? DurationUtils.toString(duration.getSeconds(), false) : null);
GitLabApiForm formData = new GitLabApiForm().withParam("duration", durationString, true);
Response response = post(Response.Status.OK, formData.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "time_estimate");
return (response.readEntity(TimeStats.class));
}
/**
* Resets the estimated time for this issue to 0 seconds.
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/reset_time_estimate
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats resetEstimatedTime(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response response = post(Response.Status.OK, new GitLabApiForm().asMap(), "projects",
getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "reset_time_estimate");
return (response.readEntity(TimeStats.class));
}
/**
* Adds spent time for this issue
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/add_spent_time
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @param duration the duration in seconds
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats addSpentTime(Object projectIdOrPath, Integer issueIid, int duration) throws GitLabApiException {
return (addSpentTime(projectIdOrPath, issueIid, new Duration(duration)));
}
/**
* Adds spent time for this issue
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/add_spent_time
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @param duration Human readable format, e.g. 3h30m
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats addSpentTime(Object projectIdOrPath, Integer issueIid, String duration) throws GitLabApiException {
return (addSpentTime(projectIdOrPath, issueIid, new Duration(duration)));
}
/**
* Adds spent time for this issue
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/add_spent_time
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @param duration the duration of time spent
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats addSpentTime(Object projectIdOrPath, Integer issueIid, Duration duration) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
String durationString = (duration != null ? DurationUtils.toString(duration.getSeconds(), false) : null);
GitLabApiForm formData = new GitLabApiForm().withParam("duration", durationString, true);
Response response = post(Response.Status.CREATED, formData.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "add_spent_time");
return (response.readEntity(TimeStats.class));
}
/**
* Resets the total spent time for this issue to 0 seconds.
*
* GitLab Endpoint: POST /projects/:id/issues/:issue_iid/reset_spent_time
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return a TimeSTats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats resetSpentTime(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response response = post(Response.Status.OK, new GitLabApiForm().asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "reset_spent_time");
return (response.readEntity(TimeStats.class));
}
/**
* Get time tracking stats.
*
* GitLab Endpoint: GET /projects/:id/issues/:issue_iid/time_stats
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return a TimeStats instance
* @throws GitLabApiException if any exception occurs
*/
public TimeStats getTimeTrackingStats(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response response = get(Response.Status.OK, new GitLabApiForm().asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "time_stats");
return (response.readEntity(TimeStats.class));
}
/**
* Get time tracking stats as an Optional instance
*
* GitLab Endpoint: GET /projects/:id/issues/:issue_iid/time_stats
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return a TimeStats as an Optional instance
*/
public OptionalGitLab Endpoint: 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 ListGitLab Endpoint: 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 ListGitLab Endpoint: 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 PagerGitLab Endpoint: 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 StreamNOTE: Only available in GitLab Starter, GitLab Bronze, and higher tiers.
* *GitLab Endpoint: GET /projects/:id/issues/:issue_iid/links
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return a list of related issues of a given issue, sorted by the relationship creation datetime (ascending)
* @throws GitLabApiException if any exception occurs
*/
public ListNOTE: Only available in GitLab Starter, GitLab Bronze, and higher tiers.
* *GitLab Endpoint: GET /projects/:id/issues/:issue_iid/links
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @param itemsPerPage the number of issues per page
* @return a Pager of related issues of a given issue, sorted by the relationship creation datetime (ascending)
* @throws GitLabApiException if any exception occurs
*/
public PagerNOTE: Only available in GitLab Starter, GitLab Bronze, and higher tiers.
* *GitLab Endpoint: GET /projects/:id/issues/:issue_iid/links
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @return a Stream of related issues of a given issue, sorted by the relationship creation datetime (ascending)
* @throws GitLabApiException if any exception occurs
*/
public StreamNOTE: Only available in GitLab Starter, GitLab Bronze, and higher tiers.
* *GitLab Endpoint: POST /projects/:id/issues/:issue_iid/links
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue
* @param targetProjectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance of the target project
* @param targetIssueIid the internal ID of a target project’s issue
* @return an instance of IssueLink holding the link relationship
* @throws GitLabApiException if any exception occurs
*/
public IssueLink createIssueLink(Object projectIdOrPath, Integer issueIid,
Object targetProjectIdOrPath, Integer targetIssueIid) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("target_project_id", getProjectIdOrPath(targetProjectIdOrPath), true)
.withParam("target_issue_iid", targetIssueIid, true);
Response response = post(Response.Status.OK, formData.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "links");
return (response.readEntity(IssueLink.class));
}
/**
* Deletes an issue link, thus removes the two-way relationship.
*
* NOTE: Only available in GitLab Starter, GitLab Bronze, and higher tiers.
* *GitLab Endpoint: POST /projects/:id/issues/:issue_iid/links/:issue_link_id
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of a project's issue, required
* @param issueLinkId the ID of an issue relationship, required
* @return an instance of IssueLink holding the deleted link relationship
* @throws GitLabApiException if any exception occurs
*/
public IssueLink deleteIssueLink(Object projectIdOrPath, Integer issueIid, Integer issueLinkId) throws GitLabApiException {
Response response = delete(Response.Status.OK, null,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "links", issueLinkId);
return (response.readEntity(IssueLink.class));
}
/**
* Get list of participants for an issue.
*
* GitLab Endpoint: GET /projects/:id/issues/:issue_iid/participants
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the IID of the issue to get the participants for
* @return a List containing all participants for the specified issue
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /projects/:id/issues/:issue_iid/participants
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the IID of the issue to get the participants for
* @param page the page to get
* @param perPage the number of projects per page
* @return a List containing all participants for the specified issue
* @throws GitLabApiException if any exception occurs
*/
public ListGitLab Endpoint: GET /projects/:id/issues/:issue_iid/participants
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the IID of the issue to get the participants for
* @param itemsPerPage the number of Participant instances that will be fetched per page
* @return a Pager containing all participants for the specified issue
* @throws GitLabApiException if any exception occurs
*/
public PagerGitLab Endpoint: GET /projects/:id/issues/:issue_iid/participants
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the IID of the issue to get the participants for
* @return a Stream containing all participants for the specified issue
* @throws GitLabApiException if any exception occurs
*/
public StreamGitLab Endpoint: GET /issues_statistics
*
* @param filter {@link IssuesStatisticsFilter} a IssuesStatisticsFilter instance with the filter settings.
* @return an IssuesStatistics instance with the statistics for the matched issues.
* @throws GitLabApiException if any exception occurs
*/
public IssuesStatistics getIssuesStatistics(IssuesStatisticsFilter filter) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
Response response = get(Response.Status.OK, formData.asMap(), "issues_statistics");
return (response.readEntity(IssuesStatistics.class));
}
/**
* Gets issues count statistics for given group.
*
* GitLab Endpoint: GET /groups/:groupId/issues_statistics
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
* @param filter {@link IssuesStatisticsFilter} a IssuesStatisticsFilter instance with the filter settings
* @return an IssuesStatistics instance with the statistics for the matched issues
* @throws GitLabApiException if any exception occurs
*/
public IssuesStatistics getGroupIssuesStatistics(Object groupIdOrPath, IssuesStatisticsFilter filter) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
Response response = get(Response.Status.OK, formData.asMap(), "groups", this.getGroupIdOrPath(groupIdOrPath), "issues_statistics");
return (response.readEntity(IssuesStatistics.class));
}
/**
* Gets issues count statistics for given group.
*
* GitLab Endpoint: GET /projects/:projectId/issues_statistics
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param filter {@link IssuesStatisticsFilter} a IssuesStatisticsFilter instance with the filter settings.
* @return an IssuesStatistics instance with the statistics for the matched issues
* @throws GitLabApiException if any exception occurs
*/
public IssuesStatistics geProjectIssuesStatistics(Object projectIdOrPath, IssuesStatisticsFilter filter) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
Response response = get(Response.Status.OK, formData.asMap(), "projects", this.getProjectIdOrPath(projectIdOrPath), "issues_statistics");
return (response.readEntity(IssuesStatistics.class));
}
}