diff --git a/backend/src/main/java/io/metersphere/track/service/IssuesService.java b/backend/src/main/java/io/metersphere/track/service/IssuesService.java index 8262f7e47b..89642bafe2 100644 --- a/backend/src/main/java/io/metersphere/track/service/IssuesService.java +++ b/backend/src/main/java/io/metersphere/track/service/IssuesService.java @@ -161,7 +161,7 @@ public class IssuesService { issueRequest.setCaseResourceId(caseResourceId); ServiceUtils.getDefaultOrder(issueRequest.getOrders()); issueRequest.setRefType(refType); - return extIssuesMapper.getIssuesByCaseId(issueRequest); + return disconnectIssue(extIssuesMapper.getIssuesByCaseId(issueRequest)); } public IssuesWithBLOBs getIssue(String id) { @@ -588,8 +588,12 @@ public class IssuesService { IssuesRequest issueRequest = new IssuesRequest(); issueRequest.setPlanId(planId); List planIssues = extIssuesMapper.getPlanIssues(issueRequest); - Set ids = new HashSet<>(planIssues.size()); - Iterator iterator = planIssues.iterator(); + return disconnectIssue(planIssues); + } + + public List disconnectIssue(List issues) { + Set ids = new HashSet<>(issues.size()); + Iterator iterator = issues.iterator(); while (iterator.hasNext()) { IssuesDao next = iterator.next(); if (ids.contains(next.getId())) { @@ -597,7 +601,7 @@ public class IssuesService { } ids.add(next.getId()); } - return planIssues; + return issues; } public void changeStatus(IssuesRequest request) {