Compare commits

...

2 Commits

Author SHA1 Message Date
Angelina Tingaeva
b3175bda4e refactor(mapping): add TESTIMPORT 2023-11-24 13:33:17 +05:00
Angelina Tingaeva
bdd6b2ab67 refactor(mapping): correct host 2023-11-24 13:06:02 +05:00

View File

@ -8,6 +8,8 @@ from yandex_tracker_client import TrackerClient
YANDEX_TRACKER_TOKEN = 'y0_AgAAAABAmFP8AArTqQAAAADyyFLmOoHqPprnRKag6B8okqjoDx2m9P0' YANDEX_TRACKER_TOKEN = 'y0_AgAAAABAmFP8AArTqQAAAADyyFLmOoHqPprnRKag6B8okqjoDx2m9P0'
ORG_ID = '35d164dcf81e48f2b6a532f4badddd33' ORG_ID = '35d164dcf81e48f2b6a532f4badddd33'
TESTIMPORT = 'https://tracker.yandex.ru/pages/projects/5'
client = TrackerClient( client = TrackerClient(
token='YANDEX_TRACKER_TOKEN', token='YANDEX_TRACKER_TOKEN',
@ -56,14 +58,14 @@ def create_tasks_in_tracker(data):
base_url = 'https://tracker.yandex.ru/v2/issues' base_url = 'https://tracker.yandex.ru/v2/issues'
headers = { headers = {
'Host': 'https://api.tracker.yandex.net', 'Host': 'api.tracker.yandex.net',
'Authorization': 'y0_AgAAAABAmFP8AArTqQAAAADyyFLmOoHqPprnRKag6B8okqjoDx2m9P0', 'Authorization': 'y0_AgAAAABAmFP8AArTqQAAAADyyFLmOoHqPprnRKag6B8okqjoDx2m9P0',
'X-Org-ID': '35d164dcf81e48f2b6a532f4badddd33', 'X-Org-ID': '35d164dcf81e48f2b6a532f4badddd33',
'Content-Type': 'Mobile&Apps/APPSANDMOBILE-1/json', 'Content-Type': 'Mobile&Apps/APPSANDMOBILE-1/json',
} }
for task in data: for task in data:
payload = { payload = {
'queue': 'TESTIMPORT', # Вынести в переменную 'queue': 'TESTIMPORT', # Вынести в переменную
'summary': task['summary'], 'summary': task['summary'],
'description': task['description'], 'description': task['description'],
'createdAt': task['createdAt'], 'createdAt': task['createdAt'],