use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.
the class JiraIssueSearchResultCreator method createExistingIssueDetails.
public ExistingIssueDetails<String> createExistingIssueDetails(JiraSearcherResponseModel issue, IssueCategory issueCategory) {
String issueCallbackLink = JiraCallbackUtils.createUILink(issue);
IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(issue, jiraIssueTransitionRetriever::fetchIssueTransitions);
return new ExistingIssueDetails<>(issue.getIssueId(), issue.getIssueKey(), issue.getSummaryField(), issueCallbackLink, issueStatus, issueCategory);
}
use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.
the class JiraIssueStatusCreatorTest method createIssueStatusExceptionTest.
@Test
public void createIssueStatusExceptionTest() {
JiraSearcherResponseModel jiraSearcherResponseModel = new JiraSearcherResponseModel(null, "unknown", null, null);
IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(jiraSearcherResponseModel, this::fetchIssueTransitionsException);
assertEquals(IssueStatus.UNKNOWN, issueStatus);
}
use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.
the class JiraIssueStatusCreatorTest method createIssueStatusReopenableTest.
@Test
public void createIssueStatusReopenableTest() {
JiraSearcherResponseModel jiraSearcherResponseModel = new JiraSearcherResponseModel(null, reopenTransition, null, null);
IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(jiraSearcherResponseModel, this::fetchIssueTransitions);
assertEquals(IssueStatus.REOPENABLE, issueStatus);
}
use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.
the class JiraIssueStatusCreatorTest method createIssueStatusUnknownTest.
@Test
public void createIssueStatusUnknownTest() {
JiraSearcherResponseModel jiraSearcherResponseModel = new JiraSearcherResponseModel(null, "unknown", null, null);
IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(jiraSearcherResponseModel, this::fetchIssueTransitions);
assertEquals(IssueStatus.UNKNOWN, issueStatus);
}
use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.
the class AzureBoardsExistingIssueDetailsCreator method createIssueDetails.
public ExistingIssueDetails<Integer> createIssueDetails(WorkItemResponseModel workItem, WorkItemFieldsWrapper workItemFields, ProjectIssueModel projectIssueModel) {
Integer workItemId = workItem.getId();
String workItemTitle = workItemFields.getField(WorkItemResponseFields.System_Title).orElse("Unknown Title");
String workItemUILink = AzureBoardsUILinkUtils.extractUILink(organizationName, workItem);
IssueCategory issueCategory = issueCategoryRetriever.retrieveIssueCategoryFromProjectIssueModel(projectIssueModel);
String workItemState = workItemFields.getField(WorkItemResponseFields.System_State).orElse("Unknown");
IssueStatus issueStatus = issueStatusResolver.resolveIssueStatus(workItemState);
return new ExistingIssueDetails<>(workItemId, Objects.toString(workItemId), workItemTitle, workItemUILink, issueStatus, issueCategory);
}
Aggregations