From 29ea9f073e9cc21e74cbb065163ce7654f41003a Mon Sep 17 00:00:00 2001 From: Cristina Amico Date: Tue, 13 Feb 2024 11:02:20 +0100 Subject: [PATCH] [Fleet] Fix wrong policy_id in dev tools flyout request (#176729) Fixes https://github.com/elastic/kibana/issues/172798 ## Summary Small bug fix: when adding a new integration, the `policy_id` in dev tools flyout request was not correct Steps to reproduce: - Add one agent policy to the stack - Go to any integration and navigate to `add integration` page - Switch to `Existing hosts` and select an existing policy. - Open `Preview API request`. The policy id in the preview should be the one from the selected policy - Switch back to `New hosts` - Open `Preview API request`. The policy id should be `` again (not the one from the previously selected policy) ![Screenshot 2024-02-12 at 17 56 45](https://github.com/elastic/kibana/assets/16084106/6f2e5085-7418-4fef-ac4e-79b57d551722) --- .../single_page_layout/hooks/devtools_request.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx index ca8c24b9a748d..90683ded5979c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx @@ -48,7 +48,7 @@ export function useDevToolsRequest({ newAgentPolicy, withSysMonitoring && !packagePolicyIsSystem )}\n\n${generateCreatePackagePolicyDevToolsRequest({ - ...packagePolicy, + ...{ ...packagePolicy, policy_id: '' }, })}`, i18n.translate( 'xpack.fleet.createPackagePolicy.devtoolsRequestWithAgentPolicyDescription',