Skip to content

Commit

Permalink
Fixed Jira not closing issues marked Not Exploitable in SAST (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsKedar authored Jul 30, 2024
1 parent 57b5972 commit be1ccdf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/com/checkmarx/flow/service/JiraService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,27 @@ Map<String, List<String>> process(ScanResults results, ScanRequest request, Scan
log.debug("Issue: {} successfully updated. Removing it from dynamic scan results map", xIssue.getValue());
nonPublishedScanResultsMap.remove(issueCurrentKey);
}
/* check if false positive exist in unFilteredMap as in filtered map we won't get data for filters like filter-state/filter-category/filter-status/filter-cwe */
for (Map.Entry<String, ScanResults.XIssue> xIssue : unFilteredMap.entrySet()) {
String issueCurrentKey = xIssue.getKey();
try{
ScanResults.XIssue currentIssue = xIssue.getValue();
if (jiraMap.containsKey(issueCurrentKey)) {
Issue issue = jiraMap.get(issueCurrentKey);
if (xIssue.getValue().isAllFalsePositive()) {
//All issues are false positive, so issue should be closed
log.debug("{} issue are false positives",issueCurrentKey);
Issue fpIssue;
fpIssue = checkForFalsePositiveIssuesInList(request, xIssue, currentIssue, issue);
closeIssueInCaseOfIssueIsInOpenState(request, closedIssues, fpIssue);
}
}

}catch (RestClientException e){
log.error("Error occurred while processing issue with key {}", issueCurrentKey, e);
throw new JiraClientException();
}
}

/*Check if an issue exists in Jira but not within results and close if not*/
closeIssueInCaseNotWithinResults(request, unFilteredMap, jiraMap, closedIssues);
Expand Down

0 comments on commit be1ccdf

Please sign in to comment.