diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-25 22:21:50 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-28 16:45:36 +0200 |
commit | 473b261261ab89fb921d12f05926ad9e9de5faee (patch) | |
tree | 4188b3b9e8c7a33065f24e63412380ec0d47c2a9 /lib | |
parent | 43e49f52e30199c9724329e71f375874eb76d554 (diff) | |
download | gitlab-ce-473b261261ab89fb921d12f05926ad9e9de5faee.tar.gz |
Back dating of issues when creating throught the API
Diffstat (limited to 'lib')
-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? |