Skip to content

Commit 6cc26a0

Browse files
author
Olaf Hoffmann
committed
Adds time tracking features to Issues API
1 parent c3ef816 commit 6cc26a0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

lib/Gitlab/Api/Issues.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,44 @@ public function removeComment($project_id, $issue_id, $note_id)
127127
return $this->delete($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes/'.$this->encodePath($note_id)));
128128
}
129129

130+
/**
131+
* @param int $project_id
132+
* @param int $issue_id
133+
* @param string $duration
134+
*/
135+
public function setTimeEstimate($project_id, $issue_id, $duration)
136+
{
137+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/time_estimate'), array('duration' => $duration));
138+
}
139+
140+
/**
141+
* @param int $project_id
142+
* @param int $issue_id
143+
*/
144+
public function resetTimeEstimate($project_id, $issue_id)
145+
{
146+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/reset_time_estimate'));
147+
}
148+
149+
/**
150+
* @param int $project_id
151+
* @param int $issue_id
152+
* @param string $duration
153+
*/
154+
public function addSpentTime($project_id, $issue_id, $duration)
155+
{
156+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/add_spent_time'), array('duration' => $duration));
157+
}
158+
159+
/**
160+
* @param int $project_id
161+
* @param int $issue_id
162+
*/
163+
public function resetSpentTime($project_id, $issue_id)
164+
{
165+
return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/reset_spent_time'));
166+
}
167+
130168
/**
131169
* @param int $project_id
132170
* @param int $issue_iid

0 commit comments

Comments
 (0)