fix: 非Sass版Jira获取不到问题类型

This commit is contained in:
chenjianxing 2022-02-10 11:47:30 +08:00 committed by zhangdahai112
parent 682bfae7c5
commit cce3559129
3 changed files with 11 additions and 2 deletions

View File

@ -61,6 +61,12 @@ public abstract class JiraAbstractClient extends BaseClient {
ResponseEntity<String> response = null;
try {
response = restTemplate.exchange(url, HttpMethod.GET, getAuthHttpEntity(), String.class, project.getId());
} catch (HttpClientErrorException e) {
if (e.getRawStatusCode() == 404) { // Sass 的jira才有这个接口报错则调用其他接口
return this.getProject(projectKey).getIssueTypes();
}
LogUtil.error(e.getMessage(), e);
MSException.throwException(e.getMessage());
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
MSException.throwException(e.getMessage());

View File

@ -3,10 +3,13 @@ package io.metersphere.track.issue.domain.jira;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class JiraIssueProject {
private String id;
private String name;
private String key;
private List<JiraIssueType> issueTypes;
}

View File

@ -10,13 +10,13 @@
</el-form-item>
<el-form-item :label-width="labelWidth" :label="$t('organization.integration.jira_issuetype')" prop="issuetype">
<el-select filterable v-model="form.issueConfigObj.jiraIssueType">
<el-option v-for="item in issueTypes" :key="item.id" :label="item.name" :value="item.untranslatedName">
<el-option v-for="item in issueTypes" :key="item.id" :label="item.name" :value="item.untranslatedName ? item.untranslatedName : item.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label-width="labelWidth" :label="$t('organization.integration.jira_storytype')" prop="storytype">
<el-select filterable v-model="form.issueConfigObj.jiraStoryType">
<el-option v-for="item in issueTypes" :key="item.id" :label="item.name" :value="item.untranslatedName">
<el-option v-for="item in issueTypes" :key="item.id" :label="item.name" :value="item.untranslatedName ? item.untranslatedName : item.name">
</el-option>
</el-select>
</el-form-item>