diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-29 10:48:39 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-29 10:48:39 -0500 |
commit | a41f5f59cbd1d29d0acc4b9d9782edabf81603b5 (patch) | |
tree | fcd45bd5f24902480c12179b9b2fbc04778ff0db /lib/api/issues.rb | |
parent | 2e5cd0f1669eea56c41bb690f28a85c3f98f68ed (diff) | |
parent | 54957d6932c2b159e01b60ee1d4e191cfdf5b713 (diff) | |
download | gitlab-ce-issue_3400_port.tar.gz |
Merge branch 'master' into issue_3400_portissue_3400_port
# Conflicts:
# app/assets/javascripts/gl_dropdown.js.coffee
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r-- | lib/api/issues.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index e5ae88eb96f..1fee1dee1a6 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -111,17 +111,21 @@ module API # Create a new project issue # # Parameters: - # id (required) - The ID of a project - # title (required) - The title of an issue - # description (optional) - The description of an issue - # assignee_id (optional) - The ID of a user to assign issue + # id (required) - The ID of a project + # title (required) - The title of an issue + # description (optional) - The description of an issue + # 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 + # labels (optional) - The labels of an issue + # created_at (optional) - The date # Example Request: # POST /projects/:id/issues post ":id/issues" do required_attributes! [:title] - attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id] + + keys = [:title, :description, :assignee_id, :milestone_id] + keys << :created_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? |