diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 2b09683608..9b796fd1c9 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -298,7 +298,9 @@ public class ApiAutomationService { private void checkCustomNumExist(SaveApiScenarioRequest request) { ApiScenarioExample example = new ApiScenarioExample(); - example.createCriteria().andCustomNumEqualTo(request.getCustomNum()) + example.createCriteria() + .andCustomNumEqualTo(request.getCustomNum()) + .andProjectIdEqualTo(request.getProjectId()) .andIdNotEqualTo(request.getId()); List list = apiScenarioMapper.selectByExample(example); if (CollectionUtils.isNotEmpty(list)) {