summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-07-12 17:59:21 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-07-12 17:59:21 +0200
commite7d9fcc1c9162271512edbd430d103c0697ccdbc (patch)
tree27fe0285dd29ad587643d11e20fbf3d9bdbea305 /lib
parent3ca9253444710c6a2d5ad4dca345f8d558be4f1a (diff)
downloadgitlab-ce-e7d9fcc1c9162271512edbd430d103c0697ccdbc.tar.gz
API: Expose due_date for issuesapi-isssues-due-date
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb1
-rw-r--r--lib/api/issues.rb10
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 301dbb688a7..40e2a487fe9 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -186,6 +186,7 @@ module API
end
expose :user_notes_count
expose :upvotes, :downvotes
+ expose :due_date
end
class ExternalIssue < Grape::Entity
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 8a03a41e9c5..c588103e517 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -152,12 +152,13 @@ module API
# milestone_id (optional) - The ID of a milestone to assign issue
# labels (optional) - The labels of an issue
# created_at (optional) - Date time string, ISO 8601 formatted
+ # due_date (optional) - Date time string in the format YEAR-MONTH-DAY
# Example Request:
# POST /projects/:id/issues
- post ":id/issues" do
+ post ':id/issues' do
required_attributes! [:title]
- keys = [:title, :description, :assignee_id, :milestone_id]
+ keys = [:title, :description, :assignee_id, :milestone_id, :due_date]
keys << :created_at if current_user.admin? || user_project.owner == current_user
attrs = attributes_for_keys(keys)
@@ -201,12 +202,13 @@ module API
# 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
+ # due_date (optional) - Date time string in the format YEAR-MONTH-DAY
# Example Request:
# PUT /projects/:id/issues/:issue_id
- put ":id/issues/:issue_id" do
+ put ':id/issues/:issue_id' do
issue = user_project.issues.find(params[:issue_id])
authorize! :update_issue, issue
- keys = [:title, :description, :assignee_id, :milestone_id, :state_event]
+ keys = [:title, :description, :assignee_id, :milestone_id, :state_event, :due_date]
keys << :updated_at if current_user.admin? || user_project.owner == current_user
attrs = attributes_for_keys(keys)