Module: Gitlab::Client::Issues
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/issues.rb
Overview
Defines methods related to issues.
Instance Method Summary collapse
-
#add_time_spent_on_issue(project, id, duration) ⇒ Object
Adds spent time for an issue.
-
#close_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Closes an issue.
-
#create_issue(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new issue.
-
#delete_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes an issue.
-
#edit_issue(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an issue.
-
#estimate_time_of_issue(project, id, duration) ⇒ Object
Sets an estimated time of work for an issue.
-
#issue(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single issue.
-
#issues(project = nil, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of user’s issues.
-
#merge_requests_closing_issue_on_merge(project, id) ⇒ Object
List merge requests that will close issue on merge.
-
#move_issue(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Move an issue.
-
#participants_on_issue(project, id) ⇒ Object
Get participants on issue.
-
#related_merge_requests(project, id) ⇒ Object
List related merge requests.
-
#reopen_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Reopens an issue.
-
#reset_time_estimate_of_issue(project, id) ⇒ Object
Resets the estimated time for an issue to 0 seconds.
-
#reset_time_spent_on_issue(project, id) ⇒ Object
Resets the total spent time for this issue to 0 seconds.
-
#subscribe_to_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Subscribe to an issue.
-
#time_stats_for_issue(project, id) ⇒ Object
Get time tracking stats for an issue.
-
#unsubscribe_from_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Unsubscribe from an issue.
Instance Method Details
#add_time_spent_on_issue(project, id, duration) ⇒ Object
Adds spent time for an issue
183 184 185 |
# File 'lib/gitlab/client/issues.rb', line 183 def add_time_spent_on_issue(project, id, duration) post("/projects/#{url_encode project}/issues/#{id}/add_spent_time", body: { duration: duration }) end |
#close_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Closes an issue.
86 87 88 |
# File 'lib/gitlab/client/issues.rb', line 86 def close_issue(project, id) put("/projects/#{url_encode project}/issues/#{id}", body: { state_event: 'close' }) end |
#create_issue(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new issue.
54 55 56 57 |
# File 'lib/gitlab/client/issues.rb', line 54 def create_issue(project, title, = {}) body = { title: title }.merge() post("/projects/#{url_encode project}/issues", body: body) end |
#delete_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes an issue. Only for admins and project owners
135 136 137 |
# File 'lib/gitlab/client/issues.rb', line 135 def delete_issue(project, id) delete("/projects/#{url_encode project}/issues/#{id}") end |
#edit_issue(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an issue.
74 75 76 |
# File 'lib/gitlab/client/issues.rb', line 74 def edit_issue(project, id, = {}) put("/projects/#{url_encode project}/issues/#{id}", body: ) end |
#estimate_time_of_issue(project, id, duration) ⇒ Object
Sets an estimated time of work for an issue.
160 161 162 |
# File 'lib/gitlab/client/issues.rb', line 160 def estimate_time_of_issue(project, id, duration) post("/projects/#{url_encode project}/issues/#{id}/time_estimate", body: { duration: url_encode(duration) }) end |
#issue(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single issue.
36 37 38 |
# File 'lib/gitlab/client/issues.rb', line 36 def issue(project, id) get("/projects/#{url_encode project}/issues/#{id}") end |
#issues(project = nil, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of user’s issues. Will return a list of project’s issues if project ID passed.
20 21 22 23 24 25 26 |
# File 'lib/gitlab/client/issues.rb', line 20 def issues(project = nil, = {}) if project.to_s.empty? && project.to_i.zero? get('/issues', query: ) else get("/projects/#{url_encode project}/issues", query: ) end end |
#merge_requests_closing_issue_on_merge(project, id) ⇒ Object
List merge requests that will close issue on merge
227 228 229 |
# File 'lib/gitlab/client/issues.rb', line 227 def merge_requests_closing_issue_on_merge(project, id) get("/projects/#{url_encode project}/issues/#{id}/closed_by") end |
#move_issue(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Move an issue.
148 149 150 |
# File 'lib/gitlab/client/issues.rb', line 148 def move_issue(project, id, = {}) post("/projects/#{url_encode project}/issues/#{id}/move", body: ) end |
#participants_on_issue(project, id) ⇒ Object
Get participants on issue
216 217 218 |
# File 'lib/gitlab/client/issues.rb', line 216 def participants_on_issue(project, id) get("/projects/#{url_encode project}/issues/#{id}/participants") end |
#related_merge_requests(project, id) ⇒ Object
List related merge requests
238 239 240 |
# File 'lib/gitlab/client/issues.rb', line 238 def (project, id) get("/projects/#{url_encode project}/issues/#{id}/related_merge_requests") end |
#reopen_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Reopens an issue.
98 99 100 |
# File 'lib/gitlab/client/issues.rb', line 98 def reopen_issue(project, id) put("/projects/#{url_encode project}/issues/#{id}", body: { state_event: 'reopen' }) end |
#reset_time_estimate_of_issue(project, id) ⇒ Object
Resets the estimated time for an issue to 0 seconds.
171 172 173 |
# File 'lib/gitlab/client/issues.rb', line 171 def reset_time_estimate_of_issue(project, id) post("/projects/#{url_encode project}/issues/#{id}/reset_time_estimate") end |
#reset_time_spent_on_issue(project, id) ⇒ Object
Resets the total spent time for this issue to 0 seconds.
194 195 196 |
# File 'lib/gitlab/client/issues.rb', line 194 def reset_time_spent_on_issue(project, id) post("/projects/#{url_encode project}/issues/#{id}/reset_spent_time") end |
#subscribe_to_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Subscribe to an issue.
110 111 112 |
# File 'lib/gitlab/client/issues.rb', line 110 def subscribe_to_issue(project, id) post("/projects/#{url_encode project}/issues/#{id}/subscribe") end |
#time_stats_for_issue(project, id) ⇒ Object
Get time tracking stats for an issue
205 206 207 |
# File 'lib/gitlab/client/issues.rb', line 205 def time_stats_for_issue(project, id) get("/projects/#{url_encode project}/issues/#{id}/time_stats") end |
#unsubscribe_from_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Unsubscribe from an issue.
122 123 124 |
# File 'lib/gitlab/client/issues.rb', line 122 def unsubscribe_from_issue(project, id) post("/projects/#{url_encode project}/issues/#{id}/unsubscribe") end |