From dd6e6bc8d68c12979a9268265c1df341d38d5a8b Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 1 Nov 2022 16:16:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20ji?= =?UTF-8?q?ra=E6=B7=BB=E5=8A=A0=E7=BB=8F=E5=8A=9E=E4=BA=BA=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016817 --user=陈建星 【测试跟踪】MS集成jira,缺陷模版添加自定义字段“经办人”,提交到jira后,经办人是空 https://www.tapd.cn/55049933/s/1284358 --- .../service/issue/platform/JiraPlatform.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/service/issue/platform/JiraPlatform.java b/test-track/backend/src/main/java/io/metersphere/service/issue/platform/JiraPlatform.java index 5c41ff60f4..4f72504911 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/issue/platform/JiraPlatform.java +++ b/test-track/backend/src/main/java/io/metersphere/service/issue/platform/JiraPlatform.java @@ -6,7 +6,6 @@ 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.DateUtils; import io.metersphere.commons.utils.JSON; import io.metersphere.commons.utils.LogUtil; import io.metersphere.xpack.track.dto.AttachmentSyncType; @@ -45,6 +44,8 @@ public class JiraPlatform extends AbstractIssuePlatform { protected JiraClientV2 jiraClientV2; protected SimpleDateFormat sdfWithZone = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + protected Boolean isSass = false; + public JiraPlatform(IssuesRequest issuesRequest) { super(issuesRequest); this.key = IssuesManagePlatform.Jira.name(); @@ -56,7 +57,7 @@ public class JiraPlatform extends AbstractIssuePlatform { public JiraClientV2 getJiraClientV2() { return jiraClientV2; } - + public void setThirdPartTemplate() { this.isThirdPartTemplate = true; } @@ -444,7 +445,7 @@ public class JiraPlatform extends AbstractIssuePlatform { if (StringUtils.equalsAny(item.getType(), "select", "radio", "member")) { Map param = new LinkedHashMap<>(); if (fieldName.equals("assignee") || fieldName.equals("reporter")) { - if (issuesRequest.isThirdPartPlatform()) { + if (issuesRequest.isThirdPartPlatform() || isSass) { param.put("id", item.getValue()); } else { param.put("name", item.getValue()); @@ -595,6 +596,9 @@ public class JiraPlatform extends AbstractIssuePlatform { public JiraConfig setConfig() { JiraConfig config = getConfig(); validateConfig(config); + if (config.getUrl().contains(".atlassian.net")) { + this.isSass = true; + } jiraClientV2.setConfig(config); return config; }