diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-07 14:07:17 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-13 11:23:42 +0200 |
commit | 482f67edb46423d4fc567e061d6546d8dfafc7bb (patch) | |
tree | 1f6d81b239da8373b319e9b35b866f9921d60519 /lib | |
parent | 8ea6c6d80c0942e0f2caee3caa0cd7503e51d45d (diff) | |
download | gitlab-ce-482f67edb46423d4fc567e061d6546d8dfafc7bb.tar.gz |
API: Ability to move an issue
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/issues.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index c4ea05ee6cf..894d9794322 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -195,6 +195,29 @@ module API end end + # Move an existing issue + # + # Parameters: + # id (required) - The ID of a project + # issue_id (required) - The ID of a project issue + # new_project_id (required) - The ID of the new project + # Example Request: + # POST /projects/:id/issues/:issue_id/move + post ":id/issues/:issue_id/move" do + required_attributes! [:new_project_id] + + issue = user_project.issues.find(params[:issue_id]) + new_project = Project.find(params[:new_project_id]) + + begin + issue = ::Issues::MoveService.new(user_project, current_user).execute(issue, new_project) + present issue, with: Entities::Issue + rescue ::Issues::MoveService::MoveError => error + render_api_error!(error.message, 400) + end + end + + # # Delete a project issue # # Parameters: |