mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 20:19:16 +08:00
fix: 非企业版勾选使用jira模板点同步缺陷会报错
This commit is contained in:
parent
ef93c1ee92
commit
bf5e92d34f
@ -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) {
|
||||
|
@ -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 ceffcd883aa519d3f7bfb2641337abaaae4c9295
|
||||
Subproject commit b0ec4c9d288471d2d9653ca5202ad067c3b380f2
|
@ -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
Block a user