Search in sources :

Example 1 with IssueCreationRequestModel

use of com.synopsys.integration.jira.common.server.model.IssueCreationRequestModel in project hub-alert by blackducksoftware.

the class JiraServerIssueCreator method createIssueCreationRequest.

@Override
protected IssueCreationRequestModel createIssueCreationRequest(IssueCreationModel alertIssueCreationModel, MessageReplacementValues replacementValues) throws AlertException {
    ProjectComponent jiraProject = retrieveProjectComponent();
    String issueSummary = distributionDetails.getIssueSummary();
    String title = alertIssueCreationModel.getTitle();
    if (StringUtils.isNotEmpty(issueSummary)) {
        MessageValueReplacementResolver messageValueReplacementResolver = new MessageValueReplacementResolver(replacementValues);
        title = messageValueReplacementResolver.createReplacedFieldValue(issueSummary);
    }
    IssueRequestModelFieldsMapBuilder fieldsBuilder = jiraIssueCreationRequestCreator.createIssueRequestModel(title, alertIssueCreationModel.getDescription(), jiraProject.getId(), distributionDetails.getIssueType(), replacementValues, distributionDetails.getCustomFields());
    return new IssueCreationRequestModel(distributionDetails.getIssueCreatorUsername(), distributionDetails.getIssueType(), distributionDetails.getProjectNameOrKey(), fieldsBuilder);
}
Also used : ProjectComponent(com.synopsys.integration.jira.common.model.components.ProjectComponent) IssueCreationRequestModel(com.synopsys.integration.jira.common.server.model.IssueCreationRequestModel) MessageValueReplacementResolver(com.synopsys.integration.alert.api.channel.jira.distribution.custom.MessageValueReplacementResolver) IssueRequestModelFieldsMapBuilder(com.synopsys.integration.jira.common.model.request.builder.IssueRequestModelFieldsMapBuilder)

Aggregations

MessageValueReplacementResolver (com.synopsys.integration.alert.api.channel.jira.distribution.custom.MessageValueReplacementResolver)1 ProjectComponent (com.synopsys.integration.jira.common.model.components.ProjectComponent)1 IssueRequestModelFieldsMapBuilder (com.synopsys.integration.jira.common.model.request.builder.IssueRequestModelFieldsMapBuilder)1 IssueCreationRequestModel (com.synopsys.integration.jira.common.server.model.IssueCreationRequestModel)1