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