diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index ae15987b19..92619b5c56 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -518,6 +518,7 @@ public class ApiDefinitionExecResultService { public List apiReportList(QueryAPIReportRequest request) { request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders(), "end_time")); + this.initReportRequest(request); List list = extApiDefinitionExecResultMapper.list(request); List userIds = list.stream().map(ApiDefinitionExecResult::getUserId) .collect(Collectors.toList()); @@ -545,4 +546,20 @@ public class ApiDefinitionExecResultService { apiDefinitionExecResultMapper.deleteByExample(apiDefinitionExecResultExample); } } + + private void initReportRequest(QueryAPIReportRequest request) { + if (request != null) { + if (MapUtils.isNotEmpty(request.getFilters()) && request.getFilters().containsKey("trigger_mode")) { + boolean filterHasApi = false; + for (String triggerMode : request.getFilters().get("trigger_mode")) { + if (StringUtils.equalsIgnoreCase(triggerMode, "api")) { + filterHasApi = true; + } + } + if (filterHasApi) { + request.getFilters().get("trigger_mode").add("JENKINS"); + } + } + } + } } diff --git a/frontend/src/business/components/common/tableItem/ReportTriggerModeItem.vue b/frontend/src/business/components/common/tableItem/ReportTriggerModeItem.vue index 45ec0f71d8..a8bf3cc27b 100644 --- a/frontend/src/business/components/common/tableItem/ReportTriggerModeItem.vue +++ b/frontend/src/business/components/common/tableItem/ReportTriggerModeItem.vue @@ -1,21 +1,22 @@