diff --git a/mapping.py b/mapping.py index 56bb889..ada7367 100644 --- a/mapping.py +++ b/mapping.py @@ -49,18 +49,19 @@ def get_task_status(task): completed_at = '' return status, completed_at + # здесь функция для дальнейшей работы с parent -def get_parent_task_ids(data, ya_imported_task_response): +def get_parent_task_ids(task, ya_imported_task_response): """ Получение соответствий между идентификаторами подзадач в Асане и Яндекс Трекере """ parent_task_ids = {} - for task in data["data"]: - if task.get('parent') and 'gid' in task['parent']: - parent_gid = task['parent']['gid'] - if parent_gid in ya_imported_task_response: - parent_id = ya_imported_task_response[parent_gid] - parent_task_ids[task['gid']] = parent_id + # for task in data["data"]: + if task.get('parent') and 'gid' in task['parent']: + parent_gid = task['parent']['gid'] + if parent_gid in ya_imported_task_response: + parent_id = ya_imported_task_response[parent_gid] + parent_task_ids[task['gid']] = parent_id return parent_task_ids