diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index d29129ce12..6fef886567 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -540,7 +540,13 @@ public class ApiTestCaseService { return; } Collections.reverse(request.getSelectIds()); - relevance(request.getSelectIds(), request); + ApiTestCaseExample example = new ApiTestCaseExample(); + example.createCriteria().andApiDefinitionIdIn(request.getSelectIds()); + List apiTestCases = apiTestCaseMapper.selectByExample(example); + List ids = apiTestCases.stream() + .map(ApiTestCase::getId) + .collect(Collectors.toList()); + relevance(ids, request); } public void relevanceByApiByReview(ApiCaseRelevanceRequest request) {