use of com.synopsys.integration.alert.api.channel.issue.search.ProjectIssueSearchResult in project hub-alert by blackducksoftware.
the class JiraComponentIssueFinder method findIssuesByComponent.
@Override
public List<ProjectIssueSearchResult<String>> findIssuesByComponent(ProviderDetails providerDetails, LinkableItem project, LinkableItem projectVersion, BomComponentDetails originalBomComponent) throws AlertException {
LinkableItem component = originalBomComponent.getComponent();
LinkableItem nullableComponentVersion = originalBomComponent.getComponentVersion().orElse(null);
String jqlString = JqlStringCreator.createBlackDuckComponentIssuesSearchString(jiraProjectKey, providerDetails.getProvider(), project, projectVersion, component, nullableComponentVersion);
List<JiraSearcherResponseModel> issueResponseModels = jqlQueryExecutor.executeQuery(jqlString);
List<ProjectIssueSearchResult<String>> searchResults = new ArrayList<>();
for (JiraSearcherResponseModel model : issueResponseModels) {
IssueBomComponentDetails issueBomComponentDetails = IssueBomComponentDetails.fromBomComponentDetails(originalBomComponent);
ProjectIssueModel projectIssueModel = ProjectIssueModel.bom(providerDetails, project, projectVersion, issueBomComponentDetails);
ProjectIssueSearchResult<String> resultFromExistingIssue = searchResultCreator.createIssueResult(model, projectIssueModel);
searchResults.add(resultFromExistingIssue);
}
return searchResults;
}
use of com.synopsys.integration.alert.api.channel.issue.search.ProjectIssueSearchResult in project hub-alert by blackducksoftware.
the class JiraIssueSearchResultCreator method createIssueResult.
public ProjectIssueSearchResult<String> createIssueResult(JiraSearcherResponseModel issue, ProjectIssueModel projectIssueModel) {
IssueCategory issueCategory = issueCategoryRetriever.retrieveIssueCategoryFromProjectIssueModel(projectIssueModel);
ExistingIssueDetails<String> issueDetails = createExistingIssueDetails(issue, issueCategory);
return new ProjectIssueSearchResult<>(issueDetails, projectIssueModel);
}
use of com.synopsys.integration.alert.api.channel.issue.search.ProjectIssueSearchResult in project hub-alert by blackducksoftware.
the class AzureBoardsComponentIssueFinder method findIssuesByComponent.
@Override
public List<ProjectIssueSearchResult<Integer>> findIssuesByComponent(ProviderDetails providerDetails, LinkableItem project, LinkableItem projectVersion, BomComponentDetails bomComponent) throws AlertException {
AzureSearchFieldMappingBuilder fieldRefNameToValue = createBomFieldReferenceToValueMap(projectVersion, bomComponent);
List<WorkItemResponseModel> workItems = workItemFinder.findWorkItems(providerDetails.getProvider(), project, fieldRefNameToValue);
List<ProjectIssueSearchResult<Integer>> searchResults = new ArrayList<>(workItems.size());
for (WorkItemResponseModel workItem : workItems) {
IssueBomComponentDetails issueBomComponent = IssueBomComponentDetails.fromBomComponentDetails(bomComponent);
ProjectIssueModel projectIssueModel = ProjectIssueModel.bom(providerDetails, project, projectVersion, issueBomComponent);
ExistingIssueDetails<Integer> issueDetails = issueDetailsCreator.createIssueDetails(workItem, workItem.createFieldsWrapper(gson), projectIssueModel);
ProjectIssueSearchResult<Integer> searchResult = new ProjectIssueSearchResult<>(issueDetails, projectIssueModel);
searchResults.add(searchResult);
}
return searchResults;
}
use of com.synopsys.integration.alert.api.channel.issue.search.ProjectIssueSearchResult in project hub-alert by blackducksoftware.
the class AzureBoardsProjectAndVersionIssueFinder method findWorkItemsAndConvertToSearchResults.
private List<ProjectIssueSearchResult<Integer>> findWorkItemsAndConvertToSearchResults(ProviderDetails providerDetails, LinkableItem project, @Nullable LinkableItem projectVersion, AzureSearchFieldMappingBuilder fieldReferenceNameToExpectedValue) throws AlertException {
List<WorkItemResponseModel> workItems = workItemFinder.findWorkItems(providerDetails.getProvider(), project, fieldReferenceNameToExpectedValue);
List<ProjectIssueSearchResult<Integer>> searchResults = new ArrayList<>(workItems.size());
for (WorkItemResponseModel workItem : workItems) {
WorkItemFieldsWrapper workItemFields = workItem.createFieldsWrapper(gson);
ProjectIssueModel projectIssueModel = createProjectIssueModel(providerDetails, project, projectVersion, workItemFields);
ExistingIssueDetails<Integer> issueDetails = issueDetailsCreator.createIssueDetails(workItem, workItemFields, projectIssueModel);
ProjectIssueSearchResult<Integer> searchResult = new ProjectIssueSearchResult<>(issueDetails, projectIssueModel);
searchResults.add(searchResult);
}
return searchResults;
}
Aggregations