fix: 非企业版勾选使用jira模板点同步缺陷会报错
This commit is contained in:
parent
558ba09d60
commit
c5c93e4071
|
@ -441,6 +441,15 @@ 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) {
|
||||
|
|
|
@ -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<IssuesDao> 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());
|
||||
|
|
|
@ -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 {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取默认的自定义字段的取值,同步之后更新成第三方平台的值
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c5ffd3071333a4582238966e32cf41ae1a7a13f5
|
||||
Subproject commit 7e0cc9ecb9ca9c13edf8b253bcf12515837e5196
|
|
@ -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() {
|
||||
|
|
|
@ -227,6 +227,7 @@ export function getPageInfo(condition) {
|
|||
result: {},
|
||||
data: [],
|
||||
condition: condition ? condition : {},
|
||||
loading: false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue