diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java index 5b8937c048..88feaca0b8 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java @@ -198,7 +198,9 @@ public class ApiDefinitionExecResultService { user = userMapper.selectByPrimaryKey(result.getUserId()); } } - + if (result.getUserId() == null && user != null) { + result.setUserId(user.getId()); + } Map paramMap = new HashMap<>(beanMap); paramMap.put("operator", user != null ? user.getName() : result.getUserId()); paramMap.put("status", result.getStatus());