Skip to content

Commit

Permalink
Merge pull request #204 from lfabriko/lfabriko-jira-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tnb-bot[bot] authored Oct 17, 2022
2 parents 9d71782 + 599fc11 commit 23df77c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.atlassian.jira.rest.client.api.domain.Comment;
import com.atlassian.jira.rest.client.api.domain.Issue;
import com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder;
import com.atlassian.jira.rest.client.api.domain.input.TransitionInput;

import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -114,4 +115,14 @@ public Iterable<Issue> getIssues(String project, String customJQL) {
return client.getSearchClient().searchJql(String.format("project = \"%s\" AND %s", project, customJQL))
.claim().getIssues();
}

public void setTransition(String issueKey, int transitionId) {
LOG.debug("Transit issue " + issueKey + " - transition id: " + transitionId);
try {
client.getIssueClient().transition(client.getIssueClient().getIssue(issueKey).claim().getTransitionsUri(),
new TransitionInput(transitionId));
} catch (Exception e) {
throw new RuntimeException("Failed to transit issue " + issueKey, e);
}
}
}

0 comments on commit 23df77c

Please sign in to comment.