From 957fd6403fc7bf8f872ac1c2b5ff24624b841e2a Mon Sep 17 00:00:00 2001 From: Angelina Tingaeva Date: Wed, 29 Nov 2023 10:31:23 +0500 Subject: [PATCH] fix(mapping): make Asana_ assignee avaliable for YaTracker (except "segavol" - he has a problem) --- mapping.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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'],