fix(测试跟踪): jira添加经办人自定义字段无效

--bug=1016817 --user=陈建星 【测试跟踪】MS集成jira,缺陷模版添加自定义字段“经办人”,提交到jira后,经办人是空 https://www.tapd.cn/55049933/s/1284358
This commit is contained in:
chenjianxing 2022-11-01 16:16:41 +08:00 committed by jianxing
parent c3da2a7584
commit dd6e6bc8d6
1 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,6 @@ import io.metersphere.commons.constants.IssuesManagePlatform;
import io.metersphere.commons.constants.IssuesStatus; import io.metersphere.commons.constants.IssuesStatus;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.DateUtils;
import io.metersphere.commons.utils.JSON; import io.metersphere.commons.utils.JSON;
import io.metersphere.commons.utils.LogUtil; import io.metersphere.commons.utils.LogUtil;
import io.metersphere.xpack.track.dto.AttachmentSyncType; import io.metersphere.xpack.track.dto.AttachmentSyncType;
@ -45,6 +44,8 @@ public class JiraPlatform extends AbstractIssuePlatform {
protected JiraClientV2 jiraClientV2; protected JiraClientV2 jiraClientV2;
protected SimpleDateFormat sdfWithZone = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); protected SimpleDateFormat sdfWithZone = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
protected Boolean isSass = false;
public JiraPlatform(IssuesRequest issuesRequest) { public JiraPlatform(IssuesRequest issuesRequest) {
super(issuesRequest); super(issuesRequest);
this.key = IssuesManagePlatform.Jira.name(); this.key = IssuesManagePlatform.Jira.name();
@ -444,7 +445,7 @@ public class JiraPlatform extends AbstractIssuePlatform {
if (StringUtils.equalsAny(item.getType(), "select", "radio", "member")) { if (StringUtils.equalsAny(item.getType(), "select", "radio", "member")) {
Map param = new LinkedHashMap<>(); Map param = new LinkedHashMap<>();
if (fieldName.equals("assignee") || fieldName.equals("reporter")) { if (fieldName.equals("assignee") || fieldName.equals("reporter")) {
if (issuesRequest.isThirdPartPlatform()) { if (issuesRequest.isThirdPartPlatform() || isSass) {
param.put("id", item.getValue()); param.put("id", item.getValue());
} else { } else {
param.put("name", item.getValue()); param.put("name", item.getValue());
@ -595,6 +596,9 @@ public class JiraPlatform extends AbstractIssuePlatform {
public JiraConfig setConfig() { public JiraConfig setConfig() {
JiraConfig config = getConfig(); JiraConfig config = getConfig();
validateConfig(config); validateConfig(config);
if (config.getUrl().contains(".atlassian.net")) {
this.isSass = true;
}
jiraClientV2.setConfig(config); jiraClientV2.setConfig(config);
return config; return config;
} }