diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-29 16:14:59 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-29 16:14:59 +0200 |
commit | b231742687cf08d8663ce34a11f1b64f1fbe4a6a (patch) | |
tree | e7cbf5b49f65b2e53e5b7e38fbb1aee2f8f80b52 /lib/api | |
parent | aabe93ce9c2c4947595f6d29628d5e1030bfb372 (diff) | |
parent | 54957d6932c2b159e01b60ee1d4e191cfdf5b713 (diff) | |
download | gitlab-ce-b231742687cf08d8663ce34a11f1b64f1fbe4a6a.tar.gz |
Merge branch 'master' into add-ability-to-archive-a-project-via-api-14296add-ability-to-archive-a-project-via-api-14296
Diffstat (limited to 'lib/api')
-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? |