From 1d9fefa7d212656082ea2771b703ea9542c389d1 Mon Sep 17 00:00:00 2001 From: itsKedar <37594766+itsKedar@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:11:29 +0530 Subject: [PATCH] Fixed Label issue for Info (#1363) --- .../java/com/checkmarx/flow/custom/GitHubIssueTracker.java | 7 ++----- .../java/com/checkmarx/flow/custom/GitLabIssueTracker.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/checkmarx/flow/custom/GitHubIssueTracker.java b/src/main/java/com/checkmarx/flow/custom/GitHubIssueTracker.java index 51863ef5e..8cf28c4f5 100644 --- a/src/main/java/com/checkmarx/flow/custom/GitHubIssueTracker.java +++ b/src/main/java/com/checkmarx/flow/custom/GitHubIssueTracker.java @@ -26,10 +26,7 @@ import org.springframework.web.client.HttpStatusCodeException; import org.springframework.web.client.RestTemplate; import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; @Service("GitHub") public class GitHubIssueTracker implements IssueTracker { @@ -337,7 +334,7 @@ private String[] getString(ScanResults.XIssue resultIssue) { try { Map findingsPerSeverity = properties.getIssueslabel(); for (Map.Entry entry : findingsPerSeverity.entrySet()) { - if(resultIssue.getSeverity().equalsIgnoreCase(entry.getKey().toString())){ + if(resultIssue.getSeverity().equalsIgnoreCase(entry.getKey().toString()) || resultIssue.getSeverity().toLowerCase(Locale.ROOT).contains(entry.getKey().toString().toLowerCase(Locale.ROOT))){ //converting using String.split() method with whitespace as a delimiter strArray = entry.getValue().split(","); break; diff --git a/src/main/java/com/checkmarx/flow/custom/GitLabIssueTracker.java b/src/main/java/com/checkmarx/flow/custom/GitLabIssueTracker.java index 555a51ed0..e0c2b5ec8 100644 --- a/src/main/java/com/checkmarx/flow/custom/GitLabIssueTracker.java +++ b/src/main/java/com/checkmarx/flow/custom/GitLabIssueTracker.java @@ -404,7 +404,7 @@ private String getString(ScanResults.XIssue resultIssue) { try { Map findingsPerSeverity = properties.getIssueslabel(); for (Map.Entry entry : findingsPerSeverity.entrySet()) { - if (resultIssue.getSeverity().equalsIgnoreCase(entry.getKey().toString())) { + if (resultIssue.getSeverity().equalsIgnoreCase(entry.getKey().toString()) || resultIssue.getSeverity().toLowerCase(Locale.ROOT).contains(entry.getKey().toString().toLowerCase(Locale.ROOT))) { label = entry.getValue(); break; }