diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java index fde1fd8561..e7594781d4 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java @@ -290,6 +290,7 @@ public class ApiTestCaseBatchRunService { TaskRequestDTO taskRequest = getTaskRequestDTO(reportId, apiTestCase, runModeConfig); taskRequest.getTaskInfo().setQueueId(queue.getQueueId()); + taskRequest.getTaskInfo().setUserId(queue.getUserId()); taskRequest.getTaskItem().setRequestCount(1L); apiExecuteService.execute(taskRequest); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseBatchRunService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseBatchRunService.java index b7e3ea35cc..c47a3ab045 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseBatchRunService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseBatchRunService.java @@ -260,6 +260,7 @@ public class TestPlanApiCaseBatchRunService { TaskBatchRequestDTO taskRequest = getTaskBatchRequestDTO(projectId, runModeConfig); taskRequest.setTaskItems(taskItems); taskRequest.getTaskInfo().setParentQueueId(parentQueueId); + taskRequest.getTaskInfo().setUserId(userId); apiExecuteService.batchExecute(taskRequest); }