Search in sources :

Example 1 with TransitionComponent

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;
}
Also used : TransitionsResponseModel(com.synopsys.integration.jira.common.model.response.TransitionsResponseModel) TransitionComponent(com.synopsys.integration.jira.common.model.components.TransitionComponent)

Example 2 with TransitionComponent

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;
}
Also used : TransitionComponent(com.synopsys.integration.jira.common.model.components.TransitionComponent) AlertException(com.synopsys.integration.alert.api.common.model.exception.AlertException)

Aggregations

TransitionComponent (com.synopsys.integration.jira.common.model.components.TransitionComponent)2 AlertException (com.synopsys.integration.alert.api.common.model.exception.AlertException)1 TransitionsResponseModel (com.synopsys.integration.jira.common.model.response.TransitionsResponseModel)1