summaryrefslogtreecommitdiff
path: root/app/services/jira_import/users_mapper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/jira_import/users_mapper.rb')
-rw-r--r--app/services/jira_import/users_mapper.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/services/jira_import/users_mapper.rb b/app/services/jira_import/users_mapper.rb
new file mode 100644
index 00000000000..31a3f721556
--- /dev/null
+++ b/app/services/jira_import/users_mapper.rb
@@ -0,0 +1,31 @@
+# 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'],
+ jira_email: jira_user['emailAddress'],
+ gitlab_id: match_user(jira_user)
+ }
+ 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)
+ nil
+ end
+ end
+end