diff --git a/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java b/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java index ae308d2201..282aba12a7 100644 --- a/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java @@ -394,7 +394,12 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform { // 用户选择框 return accountId; } else { - return valObj.getString("id"); + String id = valObj.getString("id"); + if (StringUtils.isNotBlank(id)) { + return valObj.getString("id"); + } else { + return valObj.getString("key"); + } } } 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 0bc7115c3b..c5969462f0 100644 --- a/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/JiraPlatform.java @@ -249,7 +249,7 @@ public class JiraPlatform extends AbstractIssuePlatform { project.put("key", jiraKey); JSONObject issuetype = new JSONObject(); - issuetype.put("name", issuetypeStr); + issuetype.put("id", issuetypeStr); fields.put("issuetype", issuetype); JSONObject addJiraIssueParam = new JSONObject(); @@ -484,7 +484,7 @@ public class JiraPlatform extends AbstractIssuePlatform { public String getIssueType(String configStr) { ProjectIssueConfig projectConfig = super.getProjectConfig(configStr); - String jiraIssueType = projectConfig.getJiraIssueType(); + String jiraIssueType = projectConfig.getJiraIssueTypeId(); if (StringUtils.isBlank(jiraIssueType)) { MSException.throwException("请在项目中配置 Jira 问题类型!"); } @@ -493,7 +493,7 @@ public class JiraPlatform extends AbstractIssuePlatform { public String getStoryType(String configStr) { ProjectIssueConfig projectConfig = super.getProjectConfig(configStr); - String jiraStoryType = projectConfig.getJiraStoryType(); + String jiraStoryType = projectConfig.getJiraStoryTypeId(); if (StringUtils.isBlank(jiraStoryType)) { MSException.throwException("请在项目中配置 Jira 需求类型!"); } diff --git a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java index b79d5b7141..3a38b79cf4 100644 --- a/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java +++ b/backend/src/main/java/io/metersphere/track/issue/client/JiraAbstractClient.java @@ -35,7 +35,7 @@ public abstract class JiraAbstractClient extends BaseClient { } public Map getCreateMetadata(String projectKey, String issueType) { - String url = getBaseUrl() + "/issue/createmeta?projectKeys={1}&issuetypeNames={2}&expand=projects.issuetypes.fields"; + String url = getBaseUrl() + "/issue/createmeta?projectKeys={1}&issuetypeIds={2}&expand=projects.issuetypes.fields"; ResponseEntity response = null; Map fields = null; try { diff --git a/backend/src/main/java/io/metersphere/track/issue/domain/ProjectIssueConfig.java b/backend/src/main/java/io/metersphere/track/issue/domain/ProjectIssueConfig.java index 1a5a16e83b..5d2936623e 100644 --- a/backend/src/main/java/io/metersphere/track/issue/domain/ProjectIssueConfig.java +++ b/backend/src/main/java/io/metersphere/track/issue/domain/ProjectIssueConfig.java @@ -6,7 +6,7 @@ import lombok.Setter; @Getter @Setter public class ProjectIssueConfig { - private String jiraIssueType; - private String jiraStoryType; + private String jiraIssueTypeId; + private String jiraStoryTypeId; private String projectKey; } diff --git a/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue b/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue index 446e8ced42..34d6c77697 100644 --- a/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue +++ b/frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue @@ -9,14 +9,14 @@ - - + + - - + +