diff --git a/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java b/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java index 81a92cae7f..9cfd5a8bed 100644 --- a/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java +++ b/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java @@ -283,6 +283,10 @@ private TestItemResults processParentItemResult(TestItem testItem, testItemResults.setStatus(actualStatus.orElseGet(() -> resolveStatus(testItem.getItemId()))); + if (Objects.nonNull(testItemResults.getIssue()) && testItemResults.getStatus().equals(PASSED)) { + removeItemIssue(testItemResults); + } + testItem.getAttributes().removeIf( attribute -> ATTRIBUTE_KEY_STATUS.equalsIgnoreCase(attribute.getKey()) && ATTRIBUTE_VALUE_INTERRUPTED.equalsIgnoreCase(attribute.getValue())); @@ -414,6 +418,14 @@ private void deleteOldIssueIndex(StatusEnum actualStatus, TestItem testItem, } } + private void removeItemIssue(TestItemResults testItemResults) { + issueEntityRepository.findById(testItemResults.getItemId()).ifPresent(issueEntity -> { + issueEntity.setTestItemResults(null); + issueEntityRepository.delete(issueEntity); + testItemResults.setIssue(null); + }); + } + private void updateItemIssue(TestItemResults testItemResults, IssueEntity resolvedIssue) { issueEntityRepository.findById(testItemResults.getItemId()).ifPresent(issueEntity -> { issueEntity.setTestItemResults(null);