diff --git a/backend/src/main/java/io/metersphere/service/IssueTemplateService.java b/backend/src/main/java/io/metersphere/service/IssueTemplateService.java index 4ca1ad34e9d5963dd2e57b4433d4380338f16c17..7c17908d12c381626d9a52bdd34e905087a46dab 100644 --- a/backend/src/main/java/io/metersphere/service/IssueTemplateService.java +++ b/backend/src/main/java/io/metersphere/service/IssueTemplateService.java @@ -164,10 +164,11 @@ public class IssueTemplateService extends TemplateBaseService { public List getOption(String workspaceId) { IssueTemplateExample example = new IssueTemplateExample(); example.createCriteria() - .andWorkspaceIdEqualTo(workspaceId) - .andSystemEqualTo(false); + .andWorkspaceIdEqualTo(workspaceId); + example.or().andGlobalEqualTo(true); +// .andSystemEqualTo(false); List issueTemplates = issueTemplateMapper.selectByExample(example); - issueTemplates.add(getDefaultTemplate(workspaceId)); +// issueTemplates.add(getDefaultTemplate(workspaceId)); return issueTemplates; } diff --git a/backend/src/main/resources/db/migration/V80__v1.9.0_release.sql b/backend/src/main/resources/db/migration/V80__v1.9.0_release.sql index 7cd7c8b50da1690f8bf49a3ad8a41ce5c72b1007..88a3363120ae6816fe19c0c25d5c1f1f1ccf2af0 100644 --- a/backend/src/main/resources/db/migration/V80__v1.9.0_release.sql +++ b/backend/src/main/resources/db/migration/V80__v1.9.0_release.sql @@ -88,6 +88,16 @@ CREATE TABLE IF NOT EXISTS `issue_template` ( INSERT INTO issue_template (id,`name`,platform,description,title,`global`,`system`,workspace_id,content,create_time,update_time) VALUES ('5d7c87d2-f405-4ec1-9a3d-71b514cdfda3','default','metersphere','','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000); +insert into issue_template (id,name,platform,description,title,`system`,`global`,workspace_id,content,create_time,update_time) +values ('c7f26296-cf62-4149-a4d2-ce2492729e41','JIRA-默认模版','Jira','JIRA默认模版','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000); + +insert into issue_template (id,name,platform,description,title,`system`,`global`,workspace_id,content,create_time,update_time) +values ('f2b70824-471e-426e-9219-f82aba6dd560','禅道-默认模版','Zentao','禅道默认模版','',1,1,'global','', unix_timestamp() * 1000,unix_timestamp() * 1000); + +insert into issue_template (id,name,platform,description,title,`system`,`global`,workspace_id,content,create_time,update_time) +values ('f2cd9e48-f136-4528-8249-a649c15aa3a4','TAPD-默认模版','Tapd','TAPD默认模版','',1,1,'global','',unix_timestamp() * 1000,unix_timestamp() * 1000); + + -- 字段模板关联表 CREATE TABLE IF NOT EXISTS `custom_field_template` ( `id` varchar(50) NOT NULL COMMENT 'Custom field field template related id', diff --git a/frontend/src/business/components/settings/workspace/template/TemplateSelect.vue b/frontend/src/business/components/settings/workspace/template/TemplateSelect.vue index 6a1c3a08dc791d7cf92c7e5b39039fc1632e95bc..921e791f95757e429d0b2b4b50d813c82cea4c1c 100644 --- a/frontend/src/business/components/settings/workspace/template/TemplateSelect.vue +++ b/frontend/src/business/components/settings/workspace/template/TemplateSelect.vue @@ -44,11 +44,12 @@ export default { this.$get(url + getCurrentWorkspaceId(), (response) => { this.templateOptions = response.data; if (!this.data[this.prop]) { - this.templateOptions.forEach(item => { + for(let item of this.templateOptions) { if (item.system) { - this.data[this.prop] = item.id; + this.$set(this.data, this.prop, item.id); + break; } - }); + } } }); }