From 5239755066326b80d538b52412bdb6bbb690b6a4 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 26 Jul 2023 18:30:34 +0300 Subject: [PATCH] Support include_subprojects flag in reports.get_all_ex endpoint --- apiserver/schema/services/reports.conf | 7 +++++++ apiserver/services/reports.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apiserver/schema/services/reports.conf b/apiserver/schema/services/reports.conf index 1944c2e..83ed581 100644 --- a/apiserver/schema/services/reports.conf +++ b/apiserver/schema/services/reports.conf @@ -706,6 +706,13 @@ get_all_ex { } } } + "999.0": ${get_all_ex."2.23"} { + request.properties.include_subprojects { + description: "If set to 'true' and project field is set then reports from the subprojects are searched too" + type: boolean + default: false + } + } } get_tags { "2.23" { diff --git a/apiserver/services/reports.py b/apiserver/services/reports.py index 280b1df..1a52472 100644 --- a/apiserver/services/reports.py +++ b/apiserver/services/reports.py @@ -173,7 +173,7 @@ def _delete_reports_project_if_empty(project_id): def get_all_ex(call: APICall, company_id, request: GetAllRequest): call_data = call.data call_data["type"] = TaskType.report - + process_include_subprojects(call_data) # bring projects one level down in case not the .reports project was passed if "project" in call_data: project_ids = call_data["project"]