diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java index f66f3198ec..60ad689166 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java @@ -321,10 +321,9 @@ public class ApiScenarioExecuteService { } //对报告的envMap做过滤,过滤多余的key Map diffEnvMap = new HashMap<>(); - Map envMap = runModeConfig.getEnvMap(); planEnvMap.forEach((k, v) -> { - if (envMap != null && envMap.get(k) != null) { - diffEnvMap.put(k, envMap.get(k)); + if (StringUtils.equals(planApiScenario.getProjectId(), k)) { + diffEnvMap.put(k, v); } }); runModeConfig.setEnvMap(diffEnvMap);