use of com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraCustomFieldConfig in project hub-alert by blackducksoftware.
the class JiraIssueCreationRequestCreator method createIssueRequestModel.
public IssueRequestModelFieldsBuilder createIssueRequestModel(String summary, String description, String projectId, String issueType, Collection<JiraCustomFieldConfig> customFields, MessageReplacementValues customFieldReplacementValues) {
IssueRequestModelFieldsBuilder fieldsBuilder = new IssueRequestModelFieldsBuilder().setSummary(summary).setDescription(description).setProject(projectId).setIssueType(issueType);
for (JiraCustomFieldConfig customField : customFields) {
MessageValueReplacementResolver messageValueReplacementResolver = new MessageValueReplacementResolver(customFieldReplacementValues);
String replacedFieldValue = messageValueReplacementResolver.createReplacedFieldValue(customField.getFieldOriginalValue());
customField.setFieldReplacementValue(replacedFieldValue);
JiraResolvedCustomField resolvedCustomField = jiraCustomFieldResolver.resolveCustomField(customField);
fieldsBuilder.setValue(resolvedCustomField.getFieldId(), resolvedCustomField.getFieldValue());
}
return fieldsBuilder;
}
Aggregations