case insensitive jira statuses
@@ -429,7 +429,7 @@ public class JiraService {
BugTracker bugTracker = request.getBugTracker();
String severity = issue.getSeverity();
Issue jiraIssue = this.getIssue(bugId);
- if (bugTracker.getClosedStatus().contains(jiraIssue.getStatus().getName())) {
+ if (bugTracker.getClosedStatus().stream().anyMatch(jiraIssue.getStatus().getName()::equalsIgnoreCase)) {
this.transitionIssue(bugId, bugTracker.getOpenTransition());
}
IssueInputBuilder issueBuilder = new IssueInputBuilder();
@@ -969,7 +969,7 @@ public class JiraService {
*/
private Transition getTransitionByName(Iterable<Transition> transitions, String transitionName) {
for (Transition transition : transitions) {
- if (transition.getName().equals(transitionName)) {
+ if (transition.getName().equalsIgnoreCase(transitionName)) {
return transition;
}
}
@@ -1483,7 +1483,7 @@ public class JiraService {
try {
boolean isJiraIssueAVulnerability = map.containsKey(jiraIssue.getKey());
log.trace("Trying to close JIRA issue {} with key {}.", jiraIssue.getValue().getKey(), jiraIssue.getKey());
- if (!isJiraIssueAVulnerability && (request.getBugTracker().getOpenStatus().contains(jiraIssue.getValue().getStatus().getName()))) {
+ if (!isJiraIssueAVulnerability && (request.getBugTracker().getOpenStatus().stream().anyMatch(jiraIssue.getValue().getStatus().getName()::equalsIgnoreCase))) {
/*Close the issue*/
log.info("Closing issue {} with key {}.", jiraIssue.getValue().getKey(), jiraIssue.getKey());
this.transitionCloseIssue(jiraIssue.getValue().getKey(),
@@ -1524,7 +1524,7 @@ public class JiraService {
}
private void closeIssueInCaseOfIssueIsInOpenState(ScanRequest request, List<String> closedIssues, Issue fpIssue) throws JiraClientException {
- if (request.getBugTracker().getOpenStatus().contains(fpIssue.getStatus().getName())) { //If the status is of open state, close it
+ if (request.getBugTracker().getOpenStatus().stream().anyMatch(fpIssue.getStatus().getName()::equalsIgnoreCase)) { //If the status is of open state, close it
/*Close the issue*/
log.info("Closing issue with key {}", fpIssue.getKey());
this.transitionCloseIssue(fpIssue.getKey(), request.getBugTracker().getCloseTransition(), request.getBugTracker(), true);
