diff --git a/asana_users.py b/asana_users.py index 1b91dcb..954d52a 100644 --- a/asana_users.py +++ b/asana_users.py @@ -3,7 +3,6 @@ import json import os import sys - base_dir = os.path.dirname(os.path.realpath(__file__)) asana_data_json = os.path.join(base_dir, './data/data_asana.json') diff --git a/mapping.py b/mapping.py index 5e8e5fc..4e9bdb4 100644 --- a/mapping.py +++ b/mapping.py @@ -3,6 +3,7 @@ import csv import json import os import sys +import logging import requests from yandex_tracker_client import TrackerClient @@ -13,6 +14,8 @@ ORG_ID = '35d164dcf81e48f2b6a532f4badddd33' # TESTIMPORT = 'https://tracker.yandex.ru/pages/projects/5' +logging.basicConfig(level=logging.DEBUG, filename='mapping.log', filemode='w') + client = TrackerClient( token='YANDEX_TRACKER_TOKEN', org_id='ORG_ID' @@ -83,7 +86,7 @@ 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@heado.ru' + ya_assignee = assignee[task['assignee']['gid']] if task.get('assignee', 0) !=0 else 'dr.cyrill@heado.ru' payload = { 'queue': 'TESTIMPORT', # Вынести в переменную 'summary': task['summary'],