@@ -387,7 +387,7 @@ public Optional<Issue> getOptionalIssue(Object projectIdOrPath, Integer issueIid
387
387
* Create an issue for the project.
388
388
*
389
389
* <pre><code>GitLab Endpoint: POST /projects/:id/issues</code></pre>
390
- *
390
+ *
391
391
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
392
392
* @param title the title of an issue, required
393
393
* @param description the description of an issue, optional
@@ -412,9 +412,9 @@ public Issue createIssue(Object projectIdOrPath, String title, String descriptio
412
412
* @param labels comma-separated label names for an issue, optional
413
413
* @param createdAt the date the issue was created at, optional
414
414
* @param dueDate the due date, optional
415
- * @param mergeRequestToResolveId the IID of a merge request in which to resolve all issues. This will fill the issue with a default
415
+ * @param mergeRequestToResolveId the IID of a merge request in which to resolve all issues. This will fill the issue with a default
416
416
* description and mark all discussions as resolved. When passing a description or title, these values will take precedence over the default values. Optional
417
- * @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.
417
+ * @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.
418
418
* Use in combination with merge_request_to_resolve_discussions_of. Optional
419
419
* @return an instance of Issue
420
420
* @throws GitLabApiException if any exception occurs
@@ -434,7 +434,7 @@ public Issue createIssue(Object projectIdOrPath, String title, String descriptio
434
434
.withParam ("merge_request_to_resolve_discussions_of" , mergeRequestToResolveId )
435
435
.withParam ("discussion_to_resolve" , discussionToResolveId );
436
436
Response response = post (Response .Status .CREATED , formData , "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" );
437
- return (response .readEntity (Issue .class ));
437
+ return (response .readEntity (Issue .class ));
438
438
}
439
439
440
440
/**
@@ -453,9 +453,9 @@ public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabA
453
453
throw new RuntimeException ("issue IID cannot be null" );
454
454
}
455
455
456
- GitLabApiForm formData = new GitLabApiForm ().withParam ("state_event" , StateEvent .CLOSE );
456
+ GitLabApiForm formData = new GitLabApiForm ().withParam ("state_event" , StateEvent .CLOSE );
457
457
Response response = put (Response .Status .OK , formData .asMap (), "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid );
458
- return (response .readEntity (Issue .class ));
458
+ return (response .readEntity (Issue .class ));
459
459
}
460
460
461
461
/**
@@ -477,7 +477,7 @@ public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabA
477
477
* @return an instance of the updated Issue
478
478
* @throws GitLabApiException if any exception occurs
479
479
*/
480
- public Issue updateIssue (Object projectIdOrPath , Integer issueIid , String title , String description , Boolean confidential , List <Integer > assigneeIds ,
480
+ public Issue updateIssue (Object projectIdOrPath , Integer issueIid , String title , String description , Boolean confidential , List <Integer > assigneeIds ,
481
481
Integer milestoneId , String labels , StateEvent stateEvent , Date updatedAt , Date dueDate ) throws GitLabApiException {
482
482
483
483
if (issueIid == null ) {
@@ -495,7 +495,7 @@ public Issue updateIssue(Object projectIdOrPath, Integer issueIid, String title,
495
495
.withParam ("updated_at" , updatedAt )
496
496
.withParam ("due_date" , dueDate );
497
497
Response response = put (Response .Status .OK , formData .asMap (), "projects" , getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid );
498
- return (response .readEntity (Issue .class ));
498
+ return (response .readEntity (Issue .class ));
499
499
}
500
500
501
501
/**
@@ -541,9 +541,9 @@ public void deleteIssue(Object projectIdOrPath, Integer issueIid) throws GitLabA
541
541
542
542
/**
543
543
* Sets an estimated time of work in this issue
544
- *
544
+ *
545
545
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/time_estimate</code></pre>
546
- *
546
+ *
547
547
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
548
548
* @param issueIid the internal ID of a project's issue
549
549
* @param duration estimated time in seconds
@@ -556,9 +556,9 @@ public TimeStats estimateTime(Object projectIdOrPath, Integer issueIid, int dura
556
556
557
557
/**
558
558
* Sets an estimated time of work in this issue
559
- *
559
+ *
560
560
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/time_estimate</code></pre>
561
- *
561
+ *
562
562
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
563
563
* @param issueIid the internal ID of a project's issue
564
564
* @param duration Human readable format, e.g. 3h30m
@@ -571,9 +571,9 @@ public TimeStats estimateTime(Object projectIdOrPath, Integer issueIid, String d
571
571
572
572
/**
573
573
* Sets an estimated time of work in this issue
574
- *
574
+ *
575
575
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/time_estimate</code></pre>
576
- *
576
+ *
577
577
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
578
578
* @param issueIid the internal ID of a project's issue
579
579
* @param duration set the estimate of time to this duration
@@ -596,9 +596,9 @@ public TimeStats estimateTime(Object projectIdOrPath, Integer issueIid, Duration
596
596
597
597
/**
598
598
* Resets the estimated time for this issue to 0 seconds.
599
- *
599
+ *
600
600
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/reset_time_estimate</code></pre>
601
- *
601
+ *
602
602
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
603
603
* @param issueIid the internal ID of a project's issue
604
604
* @return a TimeSTats instance
@@ -617,9 +617,9 @@ public TimeStats resetEstimatedTime(Object projectIdOrPath, Integer issueIid) th
617
617
618
618
/**
619
619
* Adds spent time for this issue
620
- *
620
+ *
621
621
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/add_spent_time</code></pre>
622
- *
622
+ *
623
623
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
624
624
* @param issueIid the internal ID of a project's issue
625
625
* @param duration the duration in seconds
@@ -632,9 +632,9 @@ public TimeStats addSpentTime(Object projectIdOrPath, Integer issueIid, int dura
632
632
633
633
/**
634
634
* Adds spent time for this issue
635
- *
635
+ *
636
636
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/add_spent_time</code></pre>
637
- *
637
+ *
638
638
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
639
639
* @param issueIid the internal ID of a project's issue
640
640
* @param duration Human readable format, e.g. 3h30m
@@ -647,9 +647,9 @@ public TimeStats addSpentTime(Object projectIdOrPath, Integer issueIid, String d
647
647
648
648
/**
649
649
* Adds spent time for this issue
650
- *
650
+ *
651
651
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/add_spent_time</code></pre>
652
- *
652
+ *
653
653
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
654
654
* @param issueIid the internal ID of a project's issue
655
655
* @param duration the duration of time spent
@@ -672,9 +672,9 @@ public TimeStats addSpentTime(Object projectIdOrPath, Integer issueIid, Duration
672
672
673
673
/**
674
674
* Resets the total spent time for this issue to 0 seconds.
675
- *
675
+ *
676
676
* <pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/reset_spent_time</code></pre>
677
- *
677
+ *
678
678
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
679
679
* @param issueIid the internal ID of a project's issue
680
680
* @return a TimeSTats instance
@@ -693,9 +693,9 @@ public TimeStats resetSpentTime(Object projectIdOrPath, Integer issueIid) throws
693
693
694
694
/**
695
695
* Get time tracking stats.
696
- *
696
+ *
697
697
* <pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/time_stats</code></pre>
698
- *
698
+ *
699
699
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
700
700
* @param issueIid the internal ID of a project's issue
701
701
* @return a TimeStats instance
@@ -983,9 +983,25 @@ public IssuesStatistics getGroupIssuesStatistics(Object groupIdOrPath, IssuesSta
983
983
return (response .readEntity (IssuesStatistics .class ));
984
984
}
985
985
986
+ /**
987
+ * Gets issues count statistics for given project.
988
+ *
989
+ * <pre><code>GitLab Endpoint: GET /projects/:projectId/issues_statistics</code></pre>
990
+ *
991
+ * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
992
+ * @param filter {@link IssuesStatisticsFilter} a IssuesStatisticsFilter instance with the filter settings.
993
+ * @return an IssuesStatistics instance with the statistics for the matched issues
994
+ * @throws GitLabApiException if any exception occurs
995
+ */
996
+ public IssuesStatistics geProjectIssuesStatistics (Object projectIdOrPath , IssuesStatisticsFilter filter ) throws GitLabApiException {
997
+ GitLabApiForm formData = filter .getQueryParams ();
998
+ Response response = get (Response .Status .OK , formData .asMap (), "projects" , this .getProjectIdOrPath (projectIdOrPath ), "issues_statistics" );
999
+ return (response .readEntity (IssuesStatistics .class ));
1000
+ }
1001
+
986
1002
/**
987
1003
* <p>Moves an issue to a different project. If the target project equals the source project or
988
- * the user has insufficient permissions to move an issue, error 400 together with an
1004
+ * the user has insufficient permissions to move an issue, error 400 together with an
989
1005
* explaining error message is returned.</p>
990
1006
*
991
1007
* <p>If a given label and/or milestone with the same name also exists in the target project,
@@ -1004,5 +1020,5 @@ public Issue moveIssue(Object projectIdOrPath, Integer issueIid, Object toProjec
1004
1020
Response response = post (Response .Status .OK , formData ,
1005
1021
"projects" , this .getProjectIdOrPath (projectIdOrPath ), "issues" , issueIid , "move" );
1006
1022
return (response .readEntity (Issue .class ));
1007
- }
1023
+ }
1008
1024
}
0 commit comments