Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active August 6, 2021 12:44
Show Gist options
  • Save percybolmer/95bc8556f35a5a4489401ac45c2894bc to your computer and use it in GitHub Desktop.
Save percybolmer/95bc8556f35a5a4489401ac45c2894bc to your computer and use it in GitHub Desktop.
// getIssueTransition will grab the available transitions for a issue
func getIssueTransition(client *jira.Client, issue jira.Issue, status string) (jira.Transition, error) {
transitions, _, err := client.Issue.GetTransitions(issue.Key)
if err != nil {
return jira.Transition{}, err
}
for _, t := range transitions {
if t.Name == status {
return t, nil
}
}
return jira.Transition{}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment