summaryrefslogtreecommitdiff
path: root/lib/api/issues.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r--lib/api/issues.rb7
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