Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active August 6, 2021 11:41
Show Gist options
  • Save percybolmer/6f06d8af9919afea175bedea41244fcb to your computer and use it in GitHub Desktop.
Save percybolmer/6f06d8af9919afea175bedea41244fcb to your computer and use it in GitHub Desktop.
// getProjects is a function that lists all projects
func getProjects(client *jira.Client) {
// use the Project domain to list all projects
projectList, _, err := client.Project.GetList()
if err != nil {
log.Fatal(err)
}
// Range over the projects and print the key and name
for _, project := range *projectList {
fmt.Printf("%s: %s\n", project.Key, project.Name)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment