diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-14 23:22:14 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-14 23:22:14 +0200 |
commit | 9d00bb08962e26b0c284bcfc5e7ed52cf141d5c6 (patch) | |
tree | 782f7f8e1223ffa27e7c34a589492c6d46e6ba2c /lib | |
parent | 2f797a140b9e4c2a5cc6b86b923cd3ff70e6d7e9 (diff) | |
download | gitlab-ce-9d00bb08962e26b0c284bcfc5e7ed52cf141d5c6.tar.gz |
Import Google Code issue assignee when mapped.google-code-import
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/google_code_import/importer.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/google_code_import/importer.rb b/lib/gitlab/google_code_import/importer.rb index 3b506efddcf..777472cf3c5 100644 --- a/lib/gitlab/google_code_import/importer.rb +++ b/lib/gitlab/google_code_import/importer.rb @@ -99,10 +99,24 @@ module Gitlab end labels << nice_status_name(raw_issue["status"]) + assignee_id = nil + if raw_issue.has_key?("owner") + username = user_map[raw_issue["owner"]["name"]] + + if username.start_with?("@") + username = username[1..-1] + + if user = User.find_by(username: username) + assignee_id = user.id + end + end + end + issue = project.issues.create!( title: raw_issue["title"], description: body, author_id: project.creator_id, + assignee_id: assignee_id, state: raw_issue["state"] == "closed" ? "closed" : "opened" ) issue.add_labels_by_names(labels) |