@@ -1525,6 +1525,65 @@ def todo(self, **kwargs):
1525
1525
r = self .gitlab ._raw_post (url , ** kwargs )
1526
1526
raise_error_from_response (r , GitlabTodoError , [201 , 304 ])
1527
1527
1528
+ def time_stats (self , ** kwargs ):
1529
+ """Get time stats for the issue.
1530
+
1531
+ Raises:
1532
+ GitlabConnectionError: If the server cannot be reached.
1533
+ """
1534
+ url = ('/projects/%(project_id)s/issues/%(issue_id)s/time_stats' %
1535
+ {'project_id' : self .project_id , 'issue_id' : self .id })
1536
+ r = self .gitlab ._raw_get (url , ** kwargs )
1537
+ raise_error_from_response (r , GitlabGetError )
1538
+ return r .json ()
1539
+
1540
+ def time_estimate (self , ** kwargs ):
1541
+ """Set an estimated time of work for the issue.
1542
+
1543
+ Raises:
1544
+ GitlabConnectionError: If the server cannot be reached.
1545
+ """
1546
+ url = ('/projects/%(project_id)s/issues/%(issue_id)s/time_estimate' %
1547
+ {'project_id' : self .project_id , 'issue_id' : self .id })
1548
+ r = self .gitlab ._raw_post (url , ** kwargs )
1549
+ raise_error_from_response (r , GitlabTimeTrackingError , 201 )
1550
+ return r .json ()
1551
+
1552
+ def reset_time_estimate (self , ** kwargs ):
1553
+ """Resets estimated time for the issue to 0 seconds.
1554
+
1555
+ Raises:
1556
+ GitlabConnectionError: If the server cannot be reached.
1557
+ """
1558
+ url = ('/projects/%(project_id)s/issues/%(issue_id)s/reset_time_estimate' %
1559
+ {'project_id' : self .project_id , 'issue_id' : self .id })
1560
+ r = self .gitlab ._raw_post (url , ** kwargs )
1561
+ raise_error_from_response (r , GitlabTimeTrackingError , 200 )
1562
+ return r .json ()
1563
+
1564
+ def add_spent_time (self , ** kwargs ):
1565
+ """Set an estimated time of work for the issue.
1566
+
1567
+ Raises:
1568
+ GitlabConnectionError: If the server cannot be reached.
1569
+ """
1570
+ url = ('/projects/%(project_id)s/issues/%(issue_id)s/reset_spent_time' %
1571
+ {'project_id' : self .project_id , 'issue_id' : self .id })
1572
+ r = self .gitlab ._raw_post (url , ** kwargs )
1573
+ raise_error_from_response (r , GitlabTimeTrackingError , 200 )
1574
+ return r .json ()
1575
+
1576
+ def reset_spent_time (self , ** kwargs ):
1577
+ """Set an estimated time of work for the issue.
1578
+
1579
+ Raises:
1580
+ GitlabConnectionError: If the server cannot be reached.
1581
+ """
1582
+ url = ('/projects/%(project_id)s/issues/%(issue_id)s/add_spent_time' %
1583
+ {'project_id' : self .project_id , 'issue_id' : self .id })
1584
+ r = self .gitlab ._raw_post (url , ** kwargs )
1585
+ raise_error_from_response (r , GitlabTimeTrackingError , 200 )
1586
+ return r .json ()
1528
1587
1529
1588
class ProjectIssueManager (BaseManager ):
1530
1589
obj_cls = ProjectIssue
0 commit comments