Skip to content

Commit

Permalink
Added support for VersionPicker field in Jira. (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithilesh Pawar authored Jul 13, 2020
1 parent 76e2007 commit 00d9430
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/checkmarx/flow/service/JiraService.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class JiraService {
private static final String LABEL_FIELD_TYPE = "labels";
private static final String SECURITY_FIELD_TYPE = "security";
private static final String VALUE_FIELD_TYPE = "value";
private static final String NAME_FIELD_TYPE = "name";
private static final String CHILD_FIELD_TYPE = "child";
private static final String CASCADE_PARENT_CHILD_DELIMITER = ";";
private static final int MAX_RESULTS_ALLOWED = 1000000;
Expand Down Expand Up @@ -658,6 +659,20 @@ private void mapCustomFields(ScanRequest request, ScanResults.XIssue issue, Issu
log.debug("cascading values {}", value);
addCascadingSelect(issueBuilder, f, customField, value);
break;
case "single-version-picker":
log.debug("single version picker");
issueBuilder.setFieldValue(customField, ComplexIssueInputFieldValue.with(NAME_FIELD_TYPE, value));
break;
case "multi-version-picker":
log.debug("multi version picker");
String[] selectedVersions = StringUtils.split(value, ",");
List<ComplexIssueInputFieldValue> versionList = new ArrayList<>();
for (String version : selectedVersions) {
ComplexIssueInputFieldValue fieldValue = ComplexIssueInputFieldValue.with(NAME_FIELD_TYPE, version.trim());
versionList.add(fieldValue);
}
issueBuilder.setFieldValue(customField, versionList);
break;
default:
log.warn("{} not a valid option for jira field type", f.getJiraFieldType());
}
Expand Down

0 comments on commit 00d9430

Please sign in to comment.