Search in sources :

Example 1 with JiraResolvedCustomField

use of com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraResolvedCustomField 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;
}
Also used : JiraResolvedCustomField(com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraResolvedCustomField) JiraCustomFieldConfig(com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraCustomFieldConfig) MessageValueReplacementResolver(com.synopsys.integration.alert.api.channel.jira.distribution.custom.MessageValueReplacementResolver) IssueRequestModelFieldsBuilder(com.synopsys.integration.jira.common.cloud.builder.IssueRequestModelFieldsBuilder)

Aggregations

JiraCustomFieldConfig (com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraCustomFieldConfig)1 JiraResolvedCustomField (com.synopsys.integration.alert.api.channel.jira.distribution.custom.JiraResolvedCustomField)1 MessageValueReplacementResolver (com.synopsys.integration.alert.api.channel.jira.distribution.custom.MessageValueReplacementResolver)1 IssueRequestModelFieldsBuilder (com.synopsys.integration.jira.common.cloud.builder.IssueRequestModelFieldsBuilder)1