2020-06-23 00:09:42 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module JiraImport
|
|
|
|
class UsersMapper
|
|
|
|
attr_reader :project, :jira_users
|
|
|
|
|
|
|
|
def initialize(project, jira_users)
|
|
|
|
@project = project
|
|
|
|
@jira_users = jira_users
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
|
|
|
jira_users.to_a.map do |jira_user|
|
|
|
|
{
|
|
|
|
jira_account_id: jira_user['accountId'],
|
|
|
|
jira_display_name: jira_user['displayName'],
|
2020-07-28 23:09:34 +05:30
|
|
|
jira_email: jira_user['emailAddress']
|
|
|
|
}.merge(match_user(jira_user))
|
2020-06-23 00:09:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# TODO: Matching user by email and displayName will be done as the part
|
|
|
|
# of follow-up issue: https://gitlab.com/gitlab-org/gitlab/-/issues/219023
|
|
|
|
def match_user(jira_user)
|
2020-07-28 23:09:34 +05:30
|
|
|
{ gitlab_id: nil, gitlab_username: nil, gitlab_name: nil }
|
2020-06-23 00:09:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|