diff --git a/mapping.py b/mapping.py index 4b51aa1..a08307c 100644 --- a/mapping.py +++ b/mapping.py @@ -56,7 +56,7 @@ def get_parent_task_ids(task, ya_imported_task_response): parent_task_ids = {} - if task.get('parent') and 'gid' in task['parent'] and task['gid'] in ya_imported_task_response: + 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] @@ -146,14 +146,14 @@ def create_tasks_in_tracker(data): parent_task_ids = get_parent_task_ids(task, ya_imported_task_response) for gid, parent_id in parent_task_ids.items(): - assign_parent_task(gid, parent_id) + assign_parent_task(ya_imported_task_response[gid], parent_id) #и эта функция для родительской задачи написана -def assign_parent_task(gid, parent_id): +def assign_parent_task(id, parent_id): """ Назначение родительской задачи """ - base_url = f'https://api.tracker.yandex.net/v2/issues/{gid}' + base_url = f'https://api.tracker.yandex.net/v2/issues/{id}' headers = { 'Host': 'api.tracker.yandex.net', 'Authorization': 'OAuth y0_AgAEA7qkB3KjAArkXwAAAADzMlP9oR1lwMzBS2e94jHzdnII8Laxi7k',