summaryrefslogtreecommitdiff
path: root/lib/api/issues.rb
diff options
context:
space:
mode:
authorMichael Greene <michael.greene@gmail.com>2016-04-05 12:05:55 -0500
committerMichael Greene <michael.greene@gmail.com>2016-04-13 12:04:09 -0500
commit28a7fe25fdf28042630282ace35e37310c8f0a12 (patch)
treecb8c857fdb640ff69af3c04c2a1122b3d4e986bc /lib/api/issues.rb
parente17f79fdfa40fb7cef02bdbc3f0f72a67da12893 (diff)
downloadgitlab-ce-28a7fe25fdf28042630282ace35e37310c8f0a12.tar.gz
Allow back dating issues on update
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r--lib/api/issues.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 4cdecadfe0f..8aa08fd5acc 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -117,7 +117,7 @@ module API
# assignee_id (optional) - The ID of a user to assign issue
# milestone_id (optional) - The ID of a milestone to assign issue
# labels (optional) - The labels of an issue
- # created_at (optional) - The date
+ # created_at (optional) - Date time string, ISO 8601 formatted
# Example Request:
# POST /projects/:id/issues
post ":id/issues" do
@@ -166,12 +166,15 @@ module API
# milestone_id (optional) - The ID of a milestone to assign issue
# labels (optional) - The labels of an issue
# state_event (optional) - The state event of an issue (close|reopen)
+ # updated_at (optional) - Date time string, ISO 8601 formatted
# Example Request:
# PUT /projects/:id/issues/:issue_id
put ":id/issues/:issue_id" do
issue = user_project.issues.find(params[:issue_id])
authorize! :update_issue, issue
- attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id, :state_event]
+ keys = [:title, :description, :assignee_id, :milestone_id, :state_event]
+ keys << :updated_at if current_user.admin? || user_project.owner == current_user
+ attrs = attributes_for_keys(keys)
# Validate label names in advance
if (errors = validate_label_params(params)).any?