fix(项目设置): 缺陷模板复制时默认值未复制

--bug=1018450 --user=宋昌昌 【项目设置】模版管理-缺陷管理-复制缺陷模版到项目B,模版中的字段默认值未复制到项目B的模版中 https://www.tapd.cn/55049933/s/1269595
This commit is contained in:
song-cc-rock 2022-10-20 15:15:21 +08:00 committed by f2c-ci-robot[bot]
parent 1664dc5335
commit a8d81d9ad5
1 changed files with 1 additions and 7 deletions

View File

@ -360,6 +360,7 @@ public class IssueTemplateService extends TemplateBaseService {
issueTemplateRecord.setUpdateTime(System.currentTimeMillis());
issueTemplateRecord.setCreateUser(SessionUtils.getUserId());
issueTemplateRecord.setProjectId(targetProjectId);
issueTemplateRecord.setGlobal(false);
issueTemplateRecords.add(issueTemplateRecord);
// 根据复制模式设置自定义字段
sourceCustomFieldTemplates.forEach(sourceCustomFieldTemplate -> {
@ -430,13 +431,6 @@ public class IssueTemplateService extends TemplateBaseService {
tarCustomFieldTemplate.setId(UUID.randomUUID().toString());
tarCustomFieldTemplate.setFieldId(tarCustomField.getId());
tarCustomFieldTemplate.setTemplateId(issueTemplateRecord.getId());
String defaultValue;
if (sourceCustomFieldTemplate.getDefaultValue() != null && tarCustomField.getOptions().contains(sourceCustomFieldTemplate.getDefaultValue())) {
defaultValue = sourceCustomFieldTemplate.getDefaultValue();
} else {
defaultValue = StringUtils.EMPTY;
}
tarCustomFieldTemplate.setDefaultValue(defaultValue);
customFieldTemplateRecords.add(tarCustomFieldTemplate);
});
});