diff options
-rw-r--r-- | lib/bitbucket_server/client.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/bitbucket_server_import/importer.rb | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/bitbucket_server/client.rb b/lib/bitbucket_server/client.rb index 9f6958b568e..eb8b592e833 100644 --- a/lib/bitbucket_server/client.rb +++ b/lib/bitbucket_server/client.rb @@ -21,9 +21,10 @@ module BitbucketServer get_collection(path, :pull_request) end - def pull_request_comments(project_key, repo, pull_request) - path = "/projects/#{project_key}/repos/#{repo}/pull-requests/#{pull_request}/comments" - get_collection(path, :pull_request_comment) + def activities(project_key, repo, pull_request) + path = "/projects/#{project_key}/repos/#{repo}/pull-requests/#{pull_request}/activities" + + collection = get_collection(path, :activities) end def pull_request_diff(project_key, repo, pull_request) diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb index dec393f053f..8cb0c7d1b1d 100644 --- a/lib/gitlab/bitbucket_server_import/importer.rb +++ b/lib/gitlab/bitbucket_server_import/importer.rb @@ -97,9 +97,9 @@ module Gitlab end def import_pull_request_comments(pull_request, merge_request) - comments = client.pull_request_comments(repo, pull_request.iid) + comments = client.activities(repo, pull_request.iid).select(&:commment?) - inline_comments, pr_comments = comments.partition(&:inline?) + inline_comments, pr_comments = comments.partition(&:inline_comment?) import_inline_comments(inline_comments, pull_request, merge_request) import_standalone_pr_comments(pr_comments, merge_request) |