summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-18 08:51:24 +0000
committerRémy Coutable <remy@rymai.me>2016-07-18 08:51:24 +0000
commit240a4aa62ab24a8a7b5545dee6bd2cf00ad7596e (patch)
tree781c7557aad8f0edbdbfe5663c160bf203805751 /lib
parentf1083ba1f6e4ff0c01d5e08b2a6c0b1f9b5a9b9a (diff)
parente7d9fcc1c9162271512edbd430d103c0697ccdbc (diff)
downloadgitlab-ce-240a4aa62ab24a8a7b5545dee6bd2cf00ad7596e.tar.gz
Merge branch 'api-isssues-due-date' into 'master'
API: Expose due_date for issues ## What does this MR do? Add support for the `due_date` of issues to the API. ## What are the relevant issue numbers? Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/18696 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5212
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 8e03c08f47b..3c79a00eb8c 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -187,6 +187,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)