diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt index 1f6986a62fa..a2884f87311 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt @@ -1084,6 +1084,18 @@ class PipelineInfoFacadeService @Autowired constructor( ) modelCheckPlugin.beforeDeleteElementInExistsModel(existModel, model, param) } + val templateId = model.templateId + + if (templateId != null) { + // 如果是根据模板创建的流水线需为model设置srcTemplateId + model.srcTemplateId = templateDao.getSrcTemplateId( + dslContext = dslContext, + projectId = projectId, + templateId = templateId, + type = TemplateType.CONSTRAINT.name + ) + } + val deployResult = pipelineRepositoryService.deployPipeline( model = model, projectId = projectId,