diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/response/BugDetailDTO.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/response/BugDetailDTO.java index 7f3603fbbe..8ed9f05c96 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/response/BugDetailDTO.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/response/BugDetailDTO.java @@ -47,5 +47,12 @@ public class BugDetailDTO { private Boolean followFlag; @Schema(description = "附件集合") - List attachments; + private List attachments; + + @Schema(description = "第三方平台缺陷ID") + private String platformBugId; + + @Schema(description = "缺陷状态") + private String status; + } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index 9ea52e7be9..3840ce1d3a 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -254,6 +254,8 @@ public class BugService { detail.setProjectId(bug.getProjectId()); detail.setTemplateId(template.getId()); detail.setPlatformDefault(template.getPlatformDefault()); + detail.setStatus(bug.getStatus()); + detail.setPlatformBugId(bug.getPlatformBugId()); if (!detail.getPlatformDefault()) { // 非平台默认模板 {标题, 内容, 标签, 自定义字段: 处理人, 状态} detail.setTitle(bug.getTitle()); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseStatusFlowSettingService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseStatusFlowSettingService.java index e8dc7c632d..fb1e4f85ad 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseStatusFlowSettingService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseStatusFlowSettingService.java @@ -20,6 +20,7 @@ import io.metersphere.system.mapper.StatusDefinitionMapper; import io.metersphere.system.uid.IDGenerator; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -296,11 +297,13 @@ public class BaseStatusFlowSettingService { } else { //修改时, 获取当前状态的流转选项值即可 List nextStatusFlows = baseStatusFlowService.getNextStatusFlows(targetStatusId); + List toIds = new ArrayList<>(); if (CollectionUtils.isEmpty(nextStatusFlows)) { - // 当前状态选项值没有下一步流转选项值, 返回空集合 - return List.of(); + // 当前状态选项值没有下一步流转选项值, 返回当前状态即可 + toIds = List.of(targetStatusId); + } else { + toIds = ListUtils.union(nextStatusFlows.stream().map(StatusFlow::getToId).collect(Collectors.toList()), List.of(targetStatusId)); } - List toIds = nextStatusFlows.stream().map(StatusFlow::getToId).toList(); List statusItems = baseStatusItemService.getToStatusItemByScopeIdAndScene(scopeId, scene, toIds); statusItems = baseStatusItemService.translateInternalStatusItem(statusItems); return statusItems.stream().map(item -> new SelectOption(item.getName(), item.getId())).toList(); diff --git a/frontend/src/models/bug-management.ts b/frontend/src/models/bug-management.ts index 8935bb9670..722d50caa6 100644 --- a/frontend/src/models/bug-management.ts +++ b/frontend/src/models/bug-management.ts @@ -1,6 +1,6 @@ -import { FormItemType } from '@/components/pure/ms-form-create/types'; +import {FormItemType} from '@/components/pure/ms-form-create/types'; -import { BatchApiParams } from './common'; +import {BatchApiParams} from './common'; export interface BugListItem { id: string; // 缺陷id @@ -86,3 +86,8 @@ export interface OperationFile { associated: boolean; // 是否是本地 还是关联 moduleId?: string; // 文件转存模块id } + +export interface BugTemplateRequest { + fromStatusId: string; // 缺陷当前状态 + platformBugKey: string; // 缺陷第三方平台Key +} diff --git a/frontend/src/views/bug-management/components/bug-detail-drawer.vue b/frontend/src/views/bug-management/components/bug-detail-drawer.vue index 059315825a..9dc65f6f57 100644 --- a/frontend/src/views/bug-management/components/bug-detail-drawer.vue +++ b/frontend/src/views/bug-management/components/bug-detail-drawer.vue @@ -155,43 +155,43 @@