diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2016-12-22 13:31:12 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-03-13 08:27:51 +0100 |
commit | 0267b83898d604181e70c5ea8ac4a84108d2e6d6 (patch) | |
tree | 3ce8cc81ba90185c976f3b19b7e548c67856370f /lib | |
parent | 9ed3db915026c6e0cd266a1c276386e3e96d2151 (diff) | |
download | gitlab-ce-0267b83898d604181e70c5ea8ac4a84108d2e6d6.tar.gz |
Delegate a single discussion to a new issue
Delegate a discussion in a merge request into a new issue.
The discussion wil be marked as resolved and a system note will be
added linking to the newly created issue.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/issues.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 4a9f2b26fb2..9aac3c8fe1a 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -118,6 +118,8 @@ module API desc: 'Date time when the issue was created. Available only for admins and project owners.' optional :merge_request_for_resolving_discussions, type: Integer, desc: 'The IID of a merge request for which to resolve discussions' + optional :discussion_to_resolve, type: String, + desc: 'The ID of a discussion to resolve' use :issue_params end post ':id/issues' do @@ -134,6 +136,11 @@ module API find_by(iid: merge_request_iid) end + if discussion_id = params[:discussion_to_resolve] + issue_params[:discussion_to_resolve] = NotesFinder.new(user_project, current_user, discussion_id: discussion_id). + first_discussion + end + issue = ::Issues::CreateService.new(user_project, current_user, issue_params.merge(request: request, api: true)).execute |