Commit 356d0c8a authored by Simon Steinbeiß's avatar Simon Steinbeiß
Browse files

Merge branch 'fix_assignee' into 'master'

Fix assignee during migration

See merge request skunnyk/bztogl!2
parents bf11b4a2 32e2e0c7
......@@ -176,18 +176,19 @@ def processbug(bgo, bzurl, instance, resolution, target, user_cache,
sudo = user_cache[bzbug.creator].id
else:
sudo = None
issue = target.create_issue(bzbug.id, bzbug.summary, description,
labels, milestone,
str(bzbug.creation_time))
#sudo=sudo)
# Assign bug to actual account if exists
print("bz issue assigned to {}".format(bzbug.assigned_to))
assignee = user_cache[bzbug.assigned_to]
print("Assign issue to {} if possible".format(assignee))
assignee_id = None
if assignee and assignee.id is not None:
print("Assign issue to {}".format(assignee))
issue.assignee_id = assignee.id
assignee_id = assignee.id
issue = target.create_issue(bzbug.id, bzbug.summary, description,
labels, milestone,
str(bzbug.creation_time),
assignee_id)
#sudo=sudo)
print("Migrating comments: ")
c = 0
......
......@@ -32,12 +32,13 @@ class GitLab:
return self.gl.projects.get(self.target_project)
def create_issue(self, id, summary, description, labels,
milestone, creation_time, sudo=None):
milestone, creation_time, assignee, sudo=None):
payload = {
'title': summary,
'description': description,
'labels': labels,
'created_at': creation_time
'created_at': creation_time,
'assignee_id': assignee
}
if milestone:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment