Fix test_rail_bot - TestRail API data structure has changed

Related-prod: PRODX-19838

Change-Id: I6fc2502a8b84609530ce8031104dcc15df9d9f7c
diff --git a/testrail_bot/control/celery_tasks/test_rail_api.py b/testrail_bot/control/celery_tasks/test_rail_api.py
index 9510b62..883261b 100644
--- a/testrail_bot/control/celery_tasks/test_rail_api.py
+++ b/testrail_bot/control/celery_tasks/test_rail_api.py
@@ -13,7 +13,7 @@
 def get_project_id(project_name):
     project = list(filter(
         lambda x: x["name"] == project_name,
-        api.projects.get_projects()))
+        api.projects.get_projects()['projects']))
     if project:
         return project[0]["id"]
     else:
@@ -21,7 +21,7 @@
 
 
 def get_plans(project_id, plan_name, **kwargs):
-    plans = api.plans.get_plans(project_id, **kwargs)
+    plans = api.plans.get_plans(project_id, **kwargs)['plans']
     return [x["id"] for x in filter(
         lambda x: plan_name in x["name"], plans)]
 
@@ -41,7 +41,7 @@
 
 def get_result_for_case(run_id, case_id):
     try:
-        results = api.results.get_results_for_case(run_id, case_id)
+        results = api.results.get_results_for_case(run_id, case_id)['results']
     except StatusCodeError:
         return None
     return results
@@ -49,7 +49,7 @@
 
 def get_failed_tests(last_run_id):
     return api.tests.get_tests(
-        last_run_id, status_id=StatusEnum.failed)
+        last_run_id, status_id=StatusEnum.failed)['tests']
 
 
 def add_result(test_id, update_dict):
diff --git a/testrail_bot/control/celery_tasks/testrail_pipeline.py b/testrail_bot/control/celery_tasks/testrail_pipeline.py
index 83d25a4..04ee22f 100644
--- a/testrail_bot/control/celery_tasks/testrail_pipeline.py
+++ b/testrail_bot/control/celery_tasks/testrail_pipeline.py
@@ -87,10 +87,10 @@
 
 def get_last_comment(last_run_id, case_id, test_run):
     last_result = test_rail_api.get_result_for_case(
-        last_run_id, case_id)[0]
+        last_run_id, case_id)
 
     return apply_filters(
-        last_result["comment"], test_run)
+        last_result[0]["comment"], test_run)
 
 
 def process_old_test(f, plan_id, case_id, last_comment, test_run, test):
@@ -117,6 +117,7 @@
 
 
 def process_test(f, test, last_run_id, test_run, plans):
+
     case_id = test["case_id"]
 
     f.write("Processing test with id {}\n".format(test["id"]))