use of com.synopsys.integration.jira.common.model.request.builder.IssueRequestModelFieldsMapBuilder in project hub-alert by blackducksoftware.
the class JiraCloudIssueCreator 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.getIssueCreatorEmail(), distributionDetails.getIssueType(), distributionDetails.getProjectNameOrKey(), fieldsBuilder, List.of());
}
use of com.synopsys.integration.jira.common.model.request.builder.IssueRequestModelFieldsMapBuilder 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);
}
Aggregations