From 037186db80259d8be7e31eb2375e392edc4b70ae Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Thu, 25 Dec 2025 12:58:07 +0200 Subject: [PATCH 01/20] command init --- .../CortexPlatformCore/CortexPlatformCore.py | 58 +++++++++++++++++++ .../CortexPlatformCore/CortexPlatformCore.yml | 17 ++++++ 2 files changed, 75 insertions(+) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 8f8fafd4d557..89c7173bda22 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -53,6 +53,7 @@ "core-get-appsec-issues", "core-update-case", "core-list-endpoints", + "core-get-case-ai-summary", ] DATA_PLATFORM_COMMANDS = ["core-get-asset-details"] APPSEC_COMMANDS = ["core-enable-scanners", "core-appsec-remediate-issue"] @@ -890,6 +891,22 @@ def unassign_case(self, case_id: str) -> dict: json_data=request_data, ) + def get_case_ai_summary(self, case_id: int) -> dict: + """ + Retrieves AI-generated summary for a specific case ID. + + Args: + case_id (int): The ID of the case to retrieve AI summary for. + + Returns: + dict: API response containing case AI summary. + """ + return self._http_request( + method="POST", + url_suffix="/cases/get_ai_case_details", + json_data={"case_id": case_id}, + ) + def get_appsec_suggestion(client: Client, issue: dict, issue_id: str) -> dict: """ @@ -3086,6 +3103,43 @@ def core_list_endpoints_command(client: Client, args: dict) -> CommandResults: ) +def get_case_ai_summary_command(client: Client, args: dict) -> CommandResults: + """ + Retrieves AI-generated summary for a specific case ID. + + Args: + client (Client): The client instance used to send the request. + args (dict): Dictionary containing the arguments for the command. + Expected to include: + - case_id (str): The ID of the case to retrieve AI summary for. + + Returns: + CommandResults: Object containing the formatted AI summary data, + raw response, and outputs for integration context. + """ + case_id = arg_to_number(args.get("case_id")) + + response = client.get_case_ai_summary(case_id) + if not response: + raise DemistoException(f"Failed to fetch ai summary for case {case_id}. Ensure the asset ID is valid.") + + reply = response.get("reply", {}) + + output = { + "case_id": reply.get("case_id"), + "case_name": reply.get("case_name"), + "case_description": reply.get("case_description"), + } + + return CommandResults( + readable_output=tableToMarkdown("Case AI Summary", output, headerTransform=string_to_table_header), + outputs_prefix=f"{INTEGRATION_CONTEXT_BRAND}.CaseAISummary", + outputs_key_field="case_id", + outputs=output, + raw_response=response, + ) + + def main(): # pragma: no cover """ Executes an integration command @@ -3208,6 +3262,10 @@ def main(): # pragma: no cover elif command == "core-list-endpoints": return_results(core_list_endpoints_command(client, args)) + + elif command == "core-get-case-ai-summary": + return_results(get_case_ai_summary_command(client, args)) + except Exception as err: demisto.error(traceback.format_exc()) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml index b37668b12bfb..384dc6059021 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml @@ -1355,6 +1355,23 @@ script: - contextPath: Core.CaseExtraData.file_artifacts.data.type description: The type of the file artifact. type: String + - arguments: + - description: The ID of the case to retrieve AI summary for. + name: case_id + required: true + type: number + name: core-get-case-ai-summary + description: Retrieves an AI-generated summary for a specific case, including case details and description. + outputs: + - contextPath: Core.CaseAISummary.case_id + description: The unique identifier for the case. + type: Number + - contextPath: Core.CaseAISummary.case_name + description: The name of the case. + type: String + - contextPath: Core.CaseAISummary.case_description + description: The AI-generated description of the case. + type: String - arguments: - description: Issue ID to update. If empty, updates the current issue ID. name: id From 4d4009ab1bda2532fb9878bb8c351fae2ad601a0 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Thu, 25 Dec 2025 17:32:08 +0200 Subject: [PATCH 02/20] small refactor --- .../CortexPlatformCore/CortexPlatformCore.py | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 89c7173bda22..8bb06bf3c4b9 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1581,27 +1581,7 @@ def map_case_format(case_list): return mapped_cases - -def get_cases_command(client, args): - """ - Retrieves cases from Cortex platform based on provided filtering criteria. - - Args: - client: The Cortex platform client instance for making API requests. - args (dict): Dictionary containing filter parameters including page number, - limits, time ranges, status, severity, and other case attributes. - - Returns: - List of mapped case objects containing case details and metadata. - """ - page = arg_to_number(args.get("page")) or 0 - limit = arg_to_number(args.get("limit")) or MAX_GET_CASES_LIMIT - - limit = page * MAX_GET_CASES_LIMIT + limit - page = page * MAX_GET_CASES_LIMIT - - sort_by_modification_time = args.get("sort_by_modification_time") - sort_by_creation_time = args.get("sort_by_creation_time") +def build_get_cases_filter(args: dict) -> FilterBuilder: since_creation_start_time = args.get("since_creation_time") since_creation_end_time = datetime.now().strftime("%Y-%m-%dT%H:%M:%S") if since_creation_start_time else None since_modification_start_time = args.get("since_modification_time") @@ -1611,8 +1591,6 @@ def get_cases_command(client, args): gte_modification_time = args.get("gte_modification_time") lte_modification_time = args.get("lte_modification_time") - sort_field, sort_order = get_cases_sort_order(sort_by_creation_time, sort_by_modification_time) - status_values = [CaseManagement.STATUS[status] for status in argToList(args.get("status"))] severity_values = [CaseManagement.SEVERITY[severity] for severity in argToList(args.get("severity"))] tag_values = [CaseManagement.TAGS.get(tag, tag) for tag in argToList(args.get("tag"))] @@ -1686,9 +1664,31 @@ def get_cases_command(client, args): }, ) + return filter_builder + +def get_cases_command(client, args): + """ + Retrieves cases from Cortex platform based on provided filtering criteria. + + Args: + client: The Cortex platform client instance for making API requests. + args (dict): Dictionary containing filter parameters including page number, + limits, time ranges, status, severity, and other case attributes. + + Returns: + List of mapped case objects containing case details and metadata. + """ + + page = arg_to_number(args.get("page")) or 0 + limit = arg_to_number(args.get("limit")) or MAX_GET_CASES_LIMIT + + limit = page * MAX_GET_CASES_LIMIT + limit + page = page * MAX_GET_CASES_LIMIT + + sort_field, sort_order = get_cases_sort_order(args.get("sort_by_creation_time"), args.get("sort_by_modification_time")) request_data = build_webapp_request_data( table_name=CASES_TABLE, - filter_dict=filter_builder.to_dict(), + filter_dict=build_get_cases_filter(args).to_dict(), limit=limit, sort_field=sort_field, sort_order=sort_order, @@ -1705,14 +1705,10 @@ def get_cases_command(client, args): filter_count = int(reply.get("FILTER_COUNT", "0")) returned_count = len(data) - command_results = [] - - command_results.append( - CommandResults( - outputs_prefix=f"{INTEGRATION_CONTEXT_BRAND}.CasesMetadata", - outputs={"filter_count": filter_count, "returned_count": returned_count}, - ) - ) + command_results = [CommandResults( + outputs_prefix=f"{INTEGRATION_CONTEXT_BRAND}.CasesMetadata", + outputs={"filter_count": filter_count, "returned_count": returned_count}, + )] get_enriched_case_data = argToBoolean(args.get("get_enriched_case_data", "false")) # In case enriched case data was requested From 90cfd526307891ae19b4a22e5b290140a1028f19 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Thu, 25 Dec 2025 18:13:14 +0200 Subject: [PATCH 03/20] command --- .../CortexPlatformCore/CortexPlatformCore.py | 63 +++++++++++++------ .../CortexPlatformCore/CortexPlatformCore.yml | 7 +++ 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 8bb06bf3c4b9..605b94bd78fd 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -15,6 +15,7 @@ SEARCH_ASSETS_DEFAULT_LIMIT = 100 MAX_GET_CASES_LIMIT = 100 MAX_GET_ENDPOINTS_LIMIT = 100 +MAX_ENRICHMENT_CASES = 10 AGENTS_TABLE = "AGENTS_TABLE" ASSET_FIELDS = { @@ -1666,6 +1667,16 @@ def build_get_cases_filter(args: dict) -> FilterBuilder: return filter_builder + +def add_cases_ai_summary(client, cases_list): + for case in cases_list: + case_id = case.get("case_id") + case_summary = get_case_ai_summary_command(client, case_id) + if case_summary: + case['description'] = case_summary.outputs.get('case_description') + return cases_list + + def get_cases_command(client, args): """ Retrieves cases from Cortex platform based on provided filtering criteria. @@ -1710,36 +1721,48 @@ def get_cases_command(client, args): outputs={"filter_count": filter_count, "returned_count": returned_count}, )] + # Check for enrichment flags get_enriched_case_data = argToBoolean(args.get("get_enriched_case_data", "false")) - # In case enriched case data was requested - if get_enriched_case_data and len(data) <= 10: - if isinstance(data, dict): - data = [data] + ai_generated_description = argToBoolean(args.get("ai_generated_description", "false")) - case_extra_data = add_cases_extra_data(client, data) + # Determine if any enrichment is requested + enrichment_requested = get_enriched_case_data or ai_generated_description + # Validate enrichment request + if enrichment_requested and len(data) > MAX_ENRICHMENT_CASES: command_results.append( CommandResults( - readable_output=tableToMarkdown("Cases", case_extra_data, headerTransform=string_to_table_header), - outputs_prefix="Core.Case", - outputs_key_field="case_id", - outputs=case_extra_data, - raw_response=case_extra_data, + readable_output=f"Cannot retrieve enriched data for more than {MAX_ENRICHMENT_CASES} cases. " + "Only standard case data will be shown. " + "Try using a more specific query, " + "for example specific case IDs you want to get enriched data for.", + entry_type=4, ) ) + enrichment_requested = False + + if isinstance(data, dict): + data = [data] + if enrichment_requested: + enriched_data = data.copy() - else: if get_enriched_case_data: - command_results.append( - CommandResults( - readable_output="Cannot retrieve enriched case data for more than 10 cases. " - "Only standard case data will be shown. " - "Try using a more specific query, " - "for example specific case IDs you want to get enriched data for.", - entry_type=4, - ) - ) + enriched_data = add_cases_extra_data(client, enriched_data) + + if ai_generated_description: + enriched_data = add_cases_ai_summary(client, enriched_data) + command_results.append( + CommandResults( + readable_output=tableToMarkdown("Cases", enriched_data, headerTransform=string_to_table_header), + outputs_prefix="Core.Case", + outputs_key_field="case_id", + outputs=enriched_data, + raw_response=data, + ) + ) + else: + # Return standard case data without enrichment command_results.append( CommandResults( readable_output=tableToMarkdown("Cases", data, headerTransform=string_to_table_header), diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml index 384dc6059021..e608f3fe54fb 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml @@ -2139,6 +2139,13 @@ script: predefined: - 'true' - 'false' + - auto: PREDEFINED + description: Whether to replace the case description in the response with the ai generated summary. Recommended for up to 10 cases. + name: ai_generated_description + defaultValue: 'false' + predefined: + - 'true' + - 'false' - description: A comma-separated list of tags to filter cases by. name: tag name: core-get-cases From c82524a0543e68a2527b8044311d6cc45aa7024d Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Sun, 28 Dec 2025 14:15:01 +0200 Subject: [PATCH 04/20] some changes --- .../CortexPlatformCore/CortexPlatformCore.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 605b94bd78fd..bd765e798242 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -15,7 +15,7 @@ SEARCH_ASSETS_DEFAULT_LIMIT = 100 MAX_GET_CASES_LIMIT = 100 MAX_GET_ENDPOINTS_LIMIT = 100 -MAX_ENRICHMENT_CASES = 10 +MAX_ENHANCED_CASES = 10 AGENTS_TABLE = "AGENTS_TABLE" ASSET_FIELDS = { @@ -1671,7 +1671,7 @@ def build_get_cases_filter(args: dict) -> FilterBuilder: def add_cases_ai_summary(client, cases_list): for case in cases_list: case_id = case.get("case_id") - case_summary = get_case_ai_summary_command(client, case_id) + case_summary = get_case_ai_summary_command(client, {"case_id" : case_id}) if case_summary: case['description'] = case_summary.outputs.get('case_description') return cases_list @@ -1726,16 +1726,16 @@ def get_cases_command(client, args): ai_generated_description = argToBoolean(args.get("ai_generated_description", "false")) # Determine if any enrichment is requested - enrichment_requested = get_enriched_case_data or ai_generated_description + enhanced_requested = get_enriched_case_data or ai_generated_description # Validate enrichment request - if enrichment_requested and len(data) > MAX_ENRICHMENT_CASES: + if enhanced_requested and len(data) > MAX_ENHANCED_CASES: command_results.append( CommandResults( - readable_output=f"Cannot retrieve enriched data for more than {MAX_ENRICHMENT_CASES} cases. " + readable_output=f"Cannot retrieve enhanced data for more than {MAX_ENHANCED_CASES} cases. " "Only standard case data will be shown. " "Try using a more specific query, " - "for example specific case IDs you want to get enriched data for.", + "for example specific case IDs you want to get enhanced data for.", entry_type=4, ) ) From e0cc62cb1265ae173cf228d4e948c62d33535c9d Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Sun, 28 Dec 2025 14:39:52 +0200 Subject: [PATCH 05/20] some changes --- .../CortexPlatformCore/CortexPlatformCore.py | 14 +++++++------- .../CortexPlatformCore/CortexPlatformCore.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index bd765e798242..9d966060da8d 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1739,25 +1739,25 @@ def get_cases_command(client, args): entry_type=4, ) ) - enrichment_requested = False + enhanced_requested = False if isinstance(data, dict): data = [data] - if enrichment_requested: - enriched_data = data.copy() + if enhanced_requested: + enhanced_data = data.copy() if get_enriched_case_data: - enriched_data = add_cases_extra_data(client, enriched_data) + enhanced_data = add_cases_extra_data(client, enhanced_data) if ai_generated_description: - enriched_data = add_cases_ai_summary(client, enriched_data) + enhanced_data = add_cases_ai_summary(client, enhanced_data) command_results.append( CommandResults( - readable_output=tableToMarkdown("Cases", enriched_data, headerTransform=string_to_table_header), + readable_output=tableToMarkdown("Cases", enhanced_data, headerTransform=string_to_table_header), outputs_prefix="Core.Case", outputs_key_field="case_id", - outputs=enriched_data, + outputs=enhanced_data, raw_response=data, ) ) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml index e608f3fe54fb..a9ddaebcc3e5 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml @@ -1361,7 +1361,7 @@ script: required: true type: number name: core-get-case-ai-summary - description: Retrieves an AI-generated summary for a specific case, including case details and description. + description: Retrieves an AI-generated summary for a specific case. outputs: - contextPath: Core.CaseAISummary.case_id description: The unique identifier for the case. From 2a2faf937a635ce066132de884cbb0833ff7d0eb Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Sun, 28 Dec 2025 15:33:09 +0200 Subject: [PATCH 06/20] init client --- .../CortexPlatformCore/CortexPlatformCore.py | 83 ++++++++++++------- 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 9d966060da8d..d0a27507263f 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1475,8 +1475,7 @@ def get_case_extra_data(client, args): """ demisto.debug(f"Calling core-get-case-extra-data, {args=}") # Set the base URL for this API call to use the public API v1 endpoint - client._base_url = "api/webapp/public_api/v1" - case_extra_data = get_extra_data_for_case_id_command(client, args).outputs + case_extra_data = get_extra_data_for_case_id_command(init_client("public"), args).outputs demisto.debug(f"After calling core-get-case-extra-data, {case_extra_data=}") issue_ids = extract_ids(case_extra_data) case_data = case_extra_data.get("case", {}) @@ -3159,6 +3158,51 @@ def get_case_ai_summary_command(client: Client, args: dict) -> CommandResults: ) +def init_client(api_type: str) -> Client: + """ + Initializes the Client for a specific API type. + + Args: + api_type (str): The category of the API (e.g., 'public', 'webapp', 'data_platform', etc.) + """ + params = demisto.params() + + # Connection parameters + proxy = params.get('proxy', False) + verify_cert = not params.get('insecure', False) + + try: + timeout = int(params.get('timeout', 120)) + except (ValueError, TypeError): + timeout = 120 + + # Base URL Mapping logic based on api_type + webapp_root = f"/api/webapp" + + url_map = { + "webapp": webapp_root, + "public": f"{webapp_root}/public_api/v1", + "data_platform": f"{webapp_root}/data-platform", + "appsec": f"{webapp_root}/public_api/appsec", + "xsoar": f"/xsoar" + } + + # Fallback to public API if the type isn't recognized + client_url = url_map.get(api_type, url_map["public"]) + + headers: dict = { + "Authorization": params.get('api_key'), + "Content-Type": "application/json" + } + + return Client( + base_url=client_url, + proxy=proxy, + verify=verify_cert, + headers=headers, + timeout=timeout, + ) + def main(): # pragma: no cover """ Executes an integration command @@ -3169,39 +3213,20 @@ def main(): # pragma: no cover args["integration_context_brand"] = INTEGRATION_CONTEXT_BRAND args["integration_name"] = INTEGRATION_NAME remove_nulls_from_dictionary(args) - headers: dict = {} - - webapp_api_url = "/api/webapp" - public_api_url = f"{webapp_api_url}/public_api/v1" - data_platform_api_url = f"{webapp_api_url}/data-platform" - appsec_api_url = f"{webapp_api_url}/public_api/appsec" - xsoar_api_url = "/xsoar" - proxy = demisto.params().get("proxy", False) - verify_cert = not demisto.params().get("insecure", False) - - try: - timeout = int(demisto.params().get("timeout", 120)) - except ValueError as e: - demisto.debug(f"Failed casting timeout parameter to int, falling back to 120 - {e}") - timeout = 120 - client_url = public_api_url + # Logic to determine which API type the current command belongs to if command in WEBAPP_COMMANDS: - client_url = webapp_api_url + api_type = "webapp" elif command in DATA_PLATFORM_COMMANDS: - client_url = data_platform_api_url + api_type = "data_platform" elif command in APPSEC_COMMANDS: - client_url = appsec_api_url + api_type = "appsec" elif command in XSOAR_COMMANDS: - client_url = xsoar_api_url + api_type = "xsoar" + else: + api_type = "public" - client = Client( - base_url=client_url, - proxy=proxy, - verify=verify_cert, - headers=headers, - timeout=timeout, - ) + client = init_client(api_type) try: if command == "test-module": From f041f78b657af6854093cd956fd8dff4b3eb7b2b Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 31 Dec 2025 10:49:55 +0200 Subject: [PATCH 07/20] refactor --- .../Integrations/CortexPlatformCore/CortexPlatformCore.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index d0a27507263f..1996c6b24c09 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1673,6 +1673,7 @@ def add_cases_ai_summary(client, cases_list): case_summary = get_case_ai_summary_command(client, {"case_id" : case_id}) if case_summary: case['description'] = case_summary.outputs.get('case_description') + case["name"] = case_summary.outputs.get('case_name') return cases_list @@ -1722,13 +1723,8 @@ def get_cases_command(client, args): # Check for enrichment flags get_enriched_case_data = argToBoolean(args.get("get_enriched_case_data", "false")) - ai_generated_description = argToBoolean(args.get("ai_generated_description", "false")) - - # Determine if any enrichment is requested - enhanced_requested = get_enriched_case_data or ai_generated_description - # Validate enrichment request - if enhanced_requested and len(data) > MAX_ENHANCED_CASES: + if get_enriched_case_data and len(data) > MAX_ENHANCED_CASES: command_results.append( CommandResults( readable_output=f"Cannot retrieve enhanced data for more than {MAX_ENHANCED_CASES} cases. " From 1bee52836ad64205356cfa389ff4a37951efe540 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Mon, 5 Jan 2026 16:51:40 +0200 Subject: [PATCH 08/20] added error handeling --- .../CortexPlatformCore/CortexPlatformCore.py | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 1996c6b24c09..e64d39e1056e 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -15,7 +15,6 @@ SEARCH_ASSETS_DEFAULT_LIMIT = 100 MAX_GET_CASES_LIMIT = 100 MAX_GET_ENDPOINTS_LIMIT = 100 -MAX_ENHANCED_CASES = 10 AGENTS_TABLE = "AGENTS_TABLE" ASSET_FIELDS = { @@ -1668,12 +1667,16 @@ def build_get_cases_filter(args: dict) -> FilterBuilder: def add_cases_ai_summary(client, cases_list): - for case in cases_list: - case_id = case.get("case_id") - case_summary = get_case_ai_summary_command(client, {"case_id" : case_id}) - if case_summary: - case['description'] = case_summary.outputs.get('case_description') - case["name"] = case_summary.outputs.get('case_name') + try: + for case in cases_list: + case_id = case.get("case_id") + print("replacing") + case_summary = get_case_ai_summary_command(client, {"case_id" : case_id}) + if case_summary: + case['description'] = case_summary.outputs.get('case_description') + case["name"] = case_summary.outputs.get('case_name') + except Exception as e: + demisto.debug(str(e)) return cases_list @@ -1721,43 +1724,39 @@ def get_cases_command(client, args): outputs={"filter_count": filter_count, "returned_count": returned_count}, )] - # Check for enrichment flags - get_enriched_case_data = argToBoolean(args.get("get_enriched_case_data", "false")) - # Validate enrichment request - if get_enriched_case_data and len(data) > MAX_ENHANCED_CASES: - command_results.append( - CommandResults( - readable_output=f"Cannot retrieve enhanced data for more than {MAX_ENHANCED_CASES} cases. " - "Only standard case data will be shown. " - "Try using a more specific query, " - "for example specific case IDs you want to get enhanced data for.", - entry_type=4, - ) - ) - enhanced_requested = False - - if isinstance(data, dict): - data = [data] - if enhanced_requested: - enhanced_data = data.copy() + if filter_count == 1 and returned_count == 1 and data[0].get("issue_count") > 1: + data = add_cases_ai_summary(client, data) - if get_enriched_case_data: - enhanced_data = add_cases_extra_data(client, enhanced_data) + get_enriched_case_data = argToBoolean(args.get("get_enriched_case_data", "false")) + # In case enriched case data was requested + if get_enriched_case_data and len(data) <= 10: + if isinstance(data, dict): + data = [data] - if ai_generated_description: - enhanced_data = add_cases_ai_summary(client, enhanced_data) + case_extra_data = add_cases_extra_data(client, data) command_results.append( CommandResults( - readable_output=tableToMarkdown("Cases", enhanced_data, headerTransform=string_to_table_header), + readable_output=tableToMarkdown("Cases", case_extra_data, headerTransform=string_to_table_header), outputs_prefix="Core.Case", outputs_key_field="case_id", - outputs=enhanced_data, - raw_response=data, + outputs=case_extra_data, + raw_response=case_extra_data, ) ) + else: - # Return standard case data without enrichment + if get_enriched_case_data: + command_results.append( + CommandResults( + readable_output="Cannot retrieve enriched case data for more than 10 cases. " + "Only standard case data will be shown. " + "Try using a more specific query, " + "for example specific case IDs you want to get enriched data for.", + entry_type=4, + ) + ) + command_results.append( CommandResults( readable_output=tableToMarkdown("Cases", data, headerTransform=string_to_table_header), From 8edfa4cb45e8d88e5c2582c41c32b0bc8bd2c0cc Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Mon, 5 Jan 2026 16:52:13 +0200 Subject: [PATCH 09/20] added error handeling --- .../Integrations/CortexPlatformCore/CortexPlatformCore.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml index a9ddaebcc3e5..9ba042b49776 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml @@ -2139,13 +2139,6 @@ script: predefined: - 'true' - 'false' - - auto: PREDEFINED - description: Whether to replace the case description in the response with the ai generated summary. Recommended for up to 10 cases. - name: ai_generated_description - defaultValue: 'false' - predefined: - - 'true' - - 'false' - description: A comma-separated list of tags to filter cases by. name: tag name: core-get-cases From a40c8ad90c97fbc7da3426e8c7fa373f05a79ed6 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Mon, 5 Jan 2026 16:57:36 +0200 Subject: [PATCH 10/20] pre commit --- .../CortexPlatformCore/CortexPlatformCore.py | 49 +++++++++---------- .../CortexPlatformCore/CortexPlatformCore.yml | 1 + 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index e64d39e1056e..1eff05e218d0 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1580,6 +1580,7 @@ def map_case_format(case_list): return mapped_cases + def build_get_cases_filter(args: dict) -> FilterBuilder: since_creation_start_time = args.get("since_creation_time") since_creation_end_time = datetime.now().strftime("%Y-%m-%dT%H:%M:%S") if since_creation_start_time else None @@ -1670,11 +1671,10 @@ def add_cases_ai_summary(client, cases_list): try: for case in cases_list: case_id = case.get("case_id") - print("replacing") - case_summary = get_case_ai_summary_command(client, {"case_id" : case_id}) + case_summary = get_case_ai_summary_command(client, {"case_id": case_id}) if case_summary: - case['description'] = case_summary.outputs.get('case_description') - case["name"] = case_summary.outputs.get('case_name') + case["description"] = case_summary.outputs.get("case_description") + case["name"] = case_summary.outputs.get("case_name") except Exception as e: demisto.debug(str(e)) return cases_list @@ -1719,10 +1719,12 @@ def get_cases_command(client, args): filter_count = int(reply.get("FILTER_COUNT", "0")) returned_count = len(data) - command_results = [CommandResults( - outputs_prefix=f"{INTEGRATION_CONTEXT_BRAND}.CasesMetadata", - outputs={"filter_count": filter_count, "returned_count": returned_count}, - )] + command_results = [ + CommandResults( + outputs_prefix=f"{INTEGRATION_CONTEXT_BRAND}.CasesMetadata", + outputs={"filter_count": filter_count, "returned_count": returned_count}, + ) + ] if filter_count == 1 and returned_count == 1 and data[0].get("issue_count") > 1: data = add_cases_ai_summary(client, data) @@ -1750,9 +1752,9 @@ def get_cases_command(client, args): command_results.append( CommandResults( readable_output="Cannot retrieve enriched case data for more than 10 cases. " - "Only standard case data will be shown. " - "Try using a more specific query, " - "for example specific case IDs you want to get enriched data for.", + "Only standard case data will be shown. " + "Try using a more specific query, " + "for example specific case IDs you want to get enriched data for.", entry_type=4, ) ) @@ -3131,19 +3133,19 @@ def get_case_ai_summary_command(client: Client, args: dict) -> CommandResults: raw response, and outputs for integration context. """ case_id = arg_to_number(args.get("case_id")) - + response = client.get_case_ai_summary(case_id) if not response: raise DemistoException(f"Failed to fetch ai summary for case {case_id}. Ensure the asset ID is valid.") reply = response.get("reply", {}) - + output = { "case_id": reply.get("case_id"), "case_name": reply.get("case_name"), "case_description": reply.get("case_description"), } - + return CommandResults( readable_output=tableToMarkdown("Case AI Summary", output, headerTransform=string_to_table_header), outputs_prefix=f"{INTEGRATION_CONTEXT_BRAND}.CaseAISummary", @@ -3163,32 +3165,29 @@ def init_client(api_type: str) -> Client: params = demisto.params() # Connection parameters - proxy = params.get('proxy', False) - verify_cert = not params.get('insecure', False) + proxy = params.get("proxy", False) + verify_cert = not params.get("insecure", False) try: - timeout = int(params.get('timeout', 120)) + timeout = int(params.get("timeout", 120)) except (ValueError, TypeError): timeout = 120 # Base URL Mapping logic based on api_type - webapp_root = f"/api/webapp" + webapp_root = "/api/webapp" url_map = { "webapp": webapp_root, "public": f"{webapp_root}/public_api/v1", "data_platform": f"{webapp_root}/data-platform", "appsec": f"{webapp_root}/public_api/appsec", - "xsoar": f"/xsoar" + "xsoar": "/xsoar", } # Fallback to public API if the type isn't recognized client_url = url_map.get(api_type, url_map["public"]) - headers: dict = { - "Authorization": params.get('api_key'), - "Content-Type": "application/json" - } + headers: dict = {"Authorization": params.get("api_key"), "Content-Type": "application/json"} return Client( base_url=client_url, @@ -3198,6 +3197,7 @@ def init_client(api_type: str) -> Client: timeout=timeout, ) + def main(): # pragma: no cover """ Executes an integration command @@ -3301,10 +3301,9 @@ def main(): # pragma: no cover elif command == "core-list-endpoints": return_results(core_list_endpoints_command(client, args)) - + elif command == "core-get-case-ai-summary": return_results(get_case_ai_summary_command(client, args)) - except Exception as err: demisto.error(traceback.format_exc()) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml index 9ba042b49776..0c1886fe28f4 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.yml @@ -1362,6 +1362,7 @@ script: type: number name: core-get-case-ai-summary description: Retrieves an AI-generated summary for a specific case. + hidden: true outputs: - contextPath: Core.CaseAISummary.case_id description: The unique identifier for the case. From 4ffb31080c47eb86f5c380742f250007d2186c30 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Mon, 5 Jan 2026 17:06:07 +0200 Subject: [PATCH 11/20] fixed tests --- .../CortexPlatformCore_test.py | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py index 8b66ebc94535..ad83e2d5adff 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py @@ -4614,7 +4614,6 @@ def test_get_case_extra_data_with_all_fields_present(mocker): args = {"case_id": "123"} result = get_case_extra_data(mock_client, args) - assert mock_client._base_url == "api/webapp/public_api/v1" assert result["issue_ids"] == ["issue1", "issue2"] assert result["network_artifacts"] == [{"id": "net1", "type": "ip"}] assert result["file_artifacts"] == [{"id": "file1", "hash": "abc123"}] @@ -4625,32 +4624,6 @@ def test_get_case_extra_data_with_all_fields_present(mocker): assert result["detection_time"] == "2023-01-01T00:00:00Z" -def test_get_case_extra_data_client_base_url_modification(mocker): - """ - Given: - A mock client with an original base URL. - When: - The get_case_extra_data function is called. - Then: - The client's base URL should be modified to "api/webapp/public_api/v1". - """ - from CortexPlatformCore import get_case_extra_data - - mock_client = mocker.Mock() - original_url = "https://original.api.endpoint" - mock_client._base_url = original_url - - mock_command_result = mocker.Mock() - mock_command_result.outputs = {} - - mocker.patch("CortexPlatformCore.get_extra_data_for_case_id_command", return_value=mock_command_result) - mocker.patch("CortexPlatformCore.extract_ids", return_value=[]) - - args = {"case_id": "url_test"} - get_case_extra_data(mock_client, args) - - assert mock_client._base_url == "api/webapp/public_api/v1" - def test_add_cases_extra_data_single_case(mocker): """ From f8557cda5e6fd52a35949fbcc0457c66575783b7 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Mon, 5 Jan 2026 17:12:17 +0200 Subject: [PATCH 12/20] doc strings --- .../CortexPlatformCore/CortexPlatformCore.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 1eff05e218d0..97538dcc5f61 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1668,6 +1668,23 @@ def build_get_cases_filter(args: dict) -> FilterBuilder: def add_cases_ai_summary(client, cases_list): + """ + Enriches a list of cases with AI-generated summaries. + + For each case in the provided list, fetches an AI-generated summary using the case ID + and updates the case's 'description' and 'name' fields with the AI-generated values. + + Args: + client: The API client instance used to fetch AI summaries + cases_list (list): List of case dictionaries, each containing at least a 'case_id' field + + Returns: + list: The enriched cases list with updated 'description' and 'name' fields where available. + Returns the original list if cases_list is None or empty. + + Note: + - If fetching AI summary fails for a case, that case remains unchanged + """ try: for case in cases_list: case_id = case.get("case_id") From ae4972405ec3b486f7b01e57f7bbc464c8da440f Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Mon, 5 Jan 2026 17:41:32 +0200 Subject: [PATCH 13/20] rn --- Packs/Core/ReleaseNotes/3_4_81.md | 10 ++++++++++ Packs/Core/pack_metadata.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Packs/Core/ReleaseNotes/3_4_81.md diff --git a/Packs/Core/ReleaseNotes/3_4_81.md b/Packs/Core/ReleaseNotes/3_4_81.md new file mode 100644 index 000000000000..505973e9e77c --- /dev/null +++ b/Packs/Core/ReleaseNotes/3_4_81.md @@ -0,0 +1,10 @@ + +- Documentation and metadata improvements. + diff --git a/Packs/Core/pack_metadata.json b/Packs/Core/pack_metadata.json index acdd79889bbf..7fdc13ae60ae 100644 --- a/Packs/Core/pack_metadata.json +++ b/Packs/Core/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Core", "description": "Automates incident response", "support": "xsoar", - "currentVersion": "3.4.70", + "currentVersion": "3.4.81", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", From 6e2b8d71205dda843d680cf220a74145baa4067c Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:05:52 +0200 Subject: [PATCH 14/20] pre commit --- .../CortexPlatformCore/CortexPlatformCore.py | 13 +++++++++---- .../CortexPlatformCore/CortexPlatformCore_test.py | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index b6f75f30da4e..b61ffa844c08 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1873,8 +1873,12 @@ def add_cases_ai_summary(client, cases_list): case_id = case.get("case_id") case_summary = get_case_ai_summary_command(client, {"case_id": case_id}) if case_summary: - case["description"] = case_summary.outputs.get("case_description") - case["name"] = case_summary.outputs.get("case_name") + outputs : dict = case_summary.outputs + if outputs: + if outputs.get("case_description"): + case["description"] = outputs.get("case_description") + if outputs.get("case_name"): + case["name"] = outputs.get("case_name") except Exception as e: demisto.debug(str(e)) return cases_list @@ -4135,7 +4139,8 @@ def get_case_ai_summary_command(client: Client, args: dict) -> CommandResults: raw response, and outputs for integration context. """ case_id = arg_to_number(args.get("case_id")) - + if case_id is None: + raise DemistoException("get_case_ai_summary_command: case_id is required.") response = client.get_case_ai_summary(case_id) if not response: raise DemistoException(f"Failed to fetch ai summary for case {case_id}. Ensure the asset ID is valid.") @@ -4184,7 +4189,7 @@ def init_client(api_type: str) -> Client: "data_platform": f"{webapp_root}/data-platform", "appsec": f"{webapp_root}/public_api/appsec", "xsoar": "/xsoar", - "agents": f"{webapp_root}/agents" + "agents": f"{webapp_root}/agents", } # Fallback to public API if the type isn't recognized diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py index 6123ea59a1dd..77a60595608c 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore_test.py @@ -4609,7 +4609,6 @@ def test_get_case_extra_data_with_all_fields_present(mocker): assert result["detection_time"] == "2023-01-01T00:00:00Z" - def test_add_cases_extra_data_single_case(mocker): """ Given: From a270cb7dbfe38ee3385540ced42e22752304a7d5 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:07:51 +0200 Subject: [PATCH 15/20] pre commit --- .../Core/Integrations/CortexPlatformCore/CortexPlatformCore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index b61ffa844c08..bf928ad384af 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1873,7 +1873,7 @@ def add_cases_ai_summary(client, cases_list): case_id = case.get("case_id") case_summary = get_case_ai_summary_command(client, {"case_id": case_id}) if case_summary: - outputs : dict = case_summary.outputs + outputs = case_summary.outputs # type: ignore if outputs: if outputs.get("case_description"): case["description"] = outputs.get("case_description") From d4a033d20e501400a91d4830b03ba12bc63fa793 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:10:15 +0200 Subject: [PATCH 16/20] pre commit --- .../CortexPlatformCore/CortexPlatformCore.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index bf928ad384af..31b9c58d04ed 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1873,12 +1873,10 @@ def add_cases_ai_summary(client, cases_list): case_id = case.get("case_id") case_summary = get_case_ai_summary_command(client, {"case_id": case_id}) if case_summary: - outputs = case_summary.outputs # type: ignore - if outputs: - if outputs.get("case_description"): - case["description"] = outputs.get("case_description") - if outputs.get("case_name"): - case["name"] = outputs.get("case_name") + if case_description:= case_summary.outputs.get("case_description"): # type: ignore + case["description"] = case_description + if case_name:= case_summary.outputs.get("case_name"): # type: ignore + case["name"] = case_name except Exception as e: demisto.debug(str(e)) return cases_list From 54aa5f92601ab03d586e6656cc483ab25637b802 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:11:54 +0200 Subject: [PATCH 17/20] pre commit --- .../Integrations/CortexPlatformCore/CortexPlatformCore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 31b9c58d04ed..9fba94b0ba16 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -1873,9 +1873,9 @@ def add_cases_ai_summary(client, cases_list): case_id = case.get("case_id") case_summary = get_case_ai_summary_command(client, {"case_id": case_id}) if case_summary: - if case_description:= case_summary.outputs.get("case_description"): # type: ignore + if case_description := case_summary.outputs.get("case_description"): # type: ignore case["description"] = case_description - if case_name:= case_summary.outputs.get("case_name"): # type: ignore + if case_name := case_summary.outputs.get("case_name"): # type: ignore case["name"] = case_name except Exception as e: demisto.debug(str(e)) From f83ebfb8a361d6315b12126faa30e8a519452313 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:16:26 +0200 Subject: [PATCH 18/20] rn --- Packs/Core/ReleaseNotes/3_4_83.md | 15 +++++++++++++++ Packs/Core/pack_metadata.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Packs/Core/ReleaseNotes/3_4_83.md diff --git a/Packs/Core/ReleaseNotes/3_4_83.md b/Packs/Core/ReleaseNotes/3_4_83.md new file mode 100644 index 000000000000..e7c6d758f64f --- /dev/null +++ b/Packs/Core/ReleaseNotes/3_4_83.md @@ -0,0 +1,15 @@ +<~PLATFORM> + +#### Integrations + +##### Cortex Platform - Core + +- Documentation and metadata improvements. + + + \ No newline at end of file diff --git a/Packs/Core/pack_metadata.json b/Packs/Core/pack_metadata.json index 7fdc13ae60ae..953e5b5908c8 100644 --- a/Packs/Core/pack_metadata.json +++ b/Packs/Core/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Core", "description": "Automates incident response", "support": "xsoar", - "currentVersion": "3.4.81", + "currentVersion": "3.4.83", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", From b3860cdac6a3c85bd9501ef464f1e374aed539d9 Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:16:59 +0200 Subject: [PATCH 19/20] rn --- Packs/Core/ReleaseNotes/3_4_81.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Packs/Core/ReleaseNotes/3_4_81.md b/Packs/Core/ReleaseNotes/3_4_81.md index 505973e9e77c..2aa3d5ac6cc3 100644 --- a/Packs/Core/ReleaseNotes/3_4_81.md +++ b/Packs/Core/ReleaseNotes/3_4_81.md @@ -1,10 +1,9 @@ -- Documentation and metadata improvements. - From a645399399805c93598e1cf56d7fc4a69d811d8d Mon Sep 17 00:00:00 2001 From: mayyagoldman Date: Wed, 7 Jan 2026 14:35:38 +0200 Subject: [PATCH 20/20] verify_platform_version --- .../Integrations/CortexPlatformCore/CortexPlatformCore.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py index 9fba94b0ba16..75a906be6819 100644 --- a/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py +++ b/Packs/Core/Integrations/CortexPlatformCore/CortexPlatformCore.py @@ -4203,6 +4203,9 @@ def init_client(api_type: str) -> Client: timeout=timeout, ) +def verify_platform_version(version : str = "8.13.0"): + if not is_demisto_version_ge(version): + raise DemistoException("This command is not available for this platform version") def main(): # pragma: no cover """ @@ -4327,12 +4330,11 @@ def main(): # pragma: no cover return_results(update_endpoint_version_command(client, args)) elif command == "core-xql-generic-query-platform": - if not is_demisto_version_ge("8.13.0"): - raise DemistoException("This command is not available for this platform version") - + verify_platform_version() return_results(xql_query_platform_command(client, args)) elif command == "core-get-case-ai-summary": + verify_platform_version() return_results(get_case_ai_summary_command(client, args)) except Exception as err: