diff --git a/mapping.py b/mapping.py index 1395481..f88be69 100644 --- a/mapping.py +++ b/mapping.py @@ -65,7 +65,7 @@ def transform_data(data): 'description': task['notes'], 'createdAt': task['created_at'], 'deadline': task['due_on'], - # 'assignee': task['assignee'], + 'assignee': task['assignee'], # 'milestone': task['section'], # 'memberships': task['memberships'], # 'parent': task[''], @@ -87,7 +87,13 @@ def create_tasks_in_tracker(data): 'Content-Type': 'appication/json', } for task in data: - ya_assignee = assignee[task['assignee']['gid']] if task.get('assignee', 0) !=0 else 'dr.cyrill' + if task.get('assignee') and 'gid' in task['assignee']: + ya_assignee = assignee.get(task['assignee']['gid'], 'dr.cyrill') + elif task.get('assignee') == 'segavol': + ya_assignee = 'dr.cyrill' + else: + ya_assignee = 'dr.cyrill' + payload = { 'queue': 'TESTIMPORT', # Вынести в переменную 'summary': task['summary'],