diff --git a/backend/src/main/java/io/metersphere/service/ProjectService.java b/backend/src/main/java/io/metersphere/service/ProjectService.java index 1d6207a095..d563f8c1ee 100644 --- a/backend/src/main/java/io/metersphere/service/ProjectService.java +++ b/backend/src/main/java/io/metersphere/service/ProjectService.java @@ -512,6 +512,16 @@ public class ProjectService { return project; } + + public boolean isThirdPartTemplate(String projectId) { + Project project = getProjectById(projectId); + if (project.getThirdPartTemplate() != null && project.getThirdPartTemplate() + && project.getPlatform().equals(IssuesManagePlatform.Jira.name())) { + return true; + } + return false; + } + public boolean useCustomNum(String projectId) { Project project = this.getProjectById(projectId); if (project != null) { diff --git a/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java b/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java index f600a2a9ad..55dc207eae 100644 --- a/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java @@ -9,6 +9,7 @@ import io.metersphere.commons.constants.CustomFieldType; import io.metersphere.commons.constants.IssuesManagePlatform; import io.metersphere.commons.constants.IssuesStatus; import io.metersphere.commons.exception.MSException; +import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.LogUtil; import io.metersphere.dto.CustomFieldDao; import io.metersphere.dto.CustomFieldItemDTO; @@ -21,6 +22,7 @@ import io.metersphere.track.issue.domain.PlatformUser; import io.metersphere.track.issue.domain.jira.*; import io.metersphere.track.request.testcase.IssuesRequest; import io.metersphere.track.request.testcase.IssuesUpdateRequest; +import io.metersphere.track.service.IssuesService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.commonmark.node.Node; @@ -297,7 +299,13 @@ public class JiraPlatform extends AbstractIssuePlatform { @Override public void syncIssues(Project project, List issues) { - isThirdPartTemplate = isThirdPartTemplate(); + super.isThirdPartTemplate = isThirdPartTemplate(); + + IssuesService issuesService = CommonBeanFactory.getBean(IssuesService.class); + if (project.getThirdPartTemplate()) { + super.defaultCustomFields = issuesService.getCustomFieldsValuesString(getThirdPartTemplate().getCustomFields()); + } + issues.forEach(item -> { try { IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(item.getId()); diff --git a/backend/src/main/java/io/metersphere/track/service/IssuesService.java b/backend/src/main/java/io/metersphere/track/service/IssuesService.java index b7a2fc3a26..08f4d4c635 100644 --- a/backend/src/main/java/io/metersphere/track/service/IssuesService.java +++ b/backend/src/main/java/io/metersphere/track/service/IssuesService.java @@ -442,8 +442,10 @@ public class IssuesService { IssuesRequest issuesRequest = new IssuesRequest(); issuesRequest.setProjectId(projectId); issuesRequest.setWorkspaceId(project.getWorkspaceId()); - String defaultCustomFields = getDefaultCustomFields(projectId); - issuesRequest.setDefaultCustomFields(defaultCustomFields); + if (!projectService.isThirdPartTemplate(projectId)) { + String defaultCustomFields = getDefaultCustomFields(projectId); + issuesRequest.setDefaultCustomFields(defaultCustomFields); + } if (CollectionUtils.isNotEmpty(tapdIssues)) { TapdPlatform tapdPlatform = new TapdPlatform(issuesRequest); @@ -471,6 +473,7 @@ public class IssuesService { } } + /** * 获取默认的自定义字段的取值,同步之后更新成第三方平台的值 * diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 451afd4ae5..916c41d6a0 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -185,6 +185,8 @@ public class TestPlanService { private ApiTestCaseService apiTestCaseService; @Resource private LoadTestMapper loadTestMapper; + @Resource + private ProjectService projectService; public synchronized TestPlan addTestPlan(AddTestPlanRequest testPlan) { if (getTestPlanByName(testPlan.getName()).size() > 0) { @@ -1827,7 +1829,6 @@ public class TestPlanService { report.setEndTime(testPlan.getActualEndTime()); report.setSummary(testPlan.getReportSummary()); report.setConfig(testPlan.getReportConfig()); - IssueTemplateDao template = issueTemplateService.getTemplate(testPlan.getProjectId()); testPlanTestCaseService.calculatePlanReport(planId, report); issuesService.calculatePlanReport(planId, report); if (testPlanExecuteReportDTO == null) { @@ -1858,7 +1859,8 @@ public class TestPlanService { } report.setName(testPlan.getName()); - if (template == null || template.getPlatform().equals("metersphere")) { + Project project = projectService.getProjectById(testPlan.getProjectId()); + if (project.getPlatform() != null && project.getPlatform().equals(IssuesManagePlatform.Local.name())) { report.setIsThirdPartIssue(false); } else { report.setIsThirdPartIssue(true); diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index ceffcd883a..b0ec4c9d28 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit ceffcd883aa519d3f7bfb2641337abaaae4c9295 +Subproject commit b0ec4c9d288471d2d9653ca5202ad067c3b380f2 diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index f75698944f..c34fcaeffd 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -225,15 +225,19 @@ export default { }, }, activated() { - // 解决错位问题 - window.addEventListener('resize', this.tableDoLayout); - getProjectMember((data) => { - this.members = data; + this.page.result.loading = true; + this.$nextTick(() => { + // 解决错位问题 + window.addEventListener('resize', this.tableDoLayout); + getProjectMember((data) => { + this.members = data; + }); + getIssuePartTemplateWithProject((template) => { + this.initFields(template); + this.page.result.loading = false; + }); + this.getIssues(); }); - getIssuePartTemplateWithProject((template) => { - this.initFields(template); - }); - this.getIssues(); }, computed: { platformFilters() { diff --git a/frontend/src/common/js/tableUtils.js b/frontend/src/common/js/tableUtils.js index dab2a7fbbf..819d59efb2 100644 --- a/frontend/src/common/js/tableUtils.js +++ b/frontend/src/common/js/tableUtils.js @@ -227,6 +227,7 @@ export function getPageInfo(condition) { result: {}, data: [], condition: condition ? condition : {}, + loading: false } }