use of com.synopsys.integration.jira.common.model.components.TransitionComponent in project hub-alert by blackducksoftware.
the class JiraIssueStatusCreatorTest method fetchIssueTransitions.
private TransitionsResponseModel fetchIssueTransitions(String testTransitionName) {
TransitionComponent transitionComponent = new TransitionComponent(null, testTransitionName, null, null, null, null, null, null);
TransitionsResponseModel transitionsResponseModel = new TransitionsResponseModel(null, List.of(transitionComponent));
return transitionsResponseModel;
}
use of com.synopsys.integration.jira.common.model.components.TransitionComponent in project hub-alert by blackducksoftware.
the class JiraIssueStatusCreator method createIssueStatus.
public IssueStatus createIssueStatus(JiraSearcherResponseModel issue, ThrowingFunction<String, TransitionsResponseModel, IntegrationException> transitionsRetriever) {
try {
String issueKey = issue.getIssueKey();
List<TransitionComponent> issueTransitions = retrieveTransitions(issueKey, transitionsRetriever);
for (TransitionComponent transition : issueTransitions) {
String transitionName = transition.getName();
if (transitionName.equals(resolveTransition)) {
return IssueStatus.RESOLVABLE;
} else if (transitionName.equals(reopenTransition)) {
return IssueStatus.REOPENABLE;
}
}
} catch (AlertException e) {
return IssueStatus.UNKNOWN;
}
return IssueStatus.UNKNOWN;
}
Aggregations