Created
August 6, 2021 12:57
-
-
Save percybolmer/eb2277660e70cc83e32df4d8d01d5401 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
// Load the .env file | |
godotenv.Load(".env") | |
// Create a BasicAuth Transport object | |
tp := jira.BasicAuthTransport{ | |
Username: os.Getenv("JIRA_USER"), | |
Password: os.Getenv("JIRA_TOKEN"), | |
} | |
// Create a new Jira Client | |
client, err := jira.NewClient(tp.Client(), os.Getenv("JIRA_URL")) | |
if err != nil { | |
log.Fatal(err) | |
} | |
//getProjects(client) | |
issues, err := getIssues(client, "project = 'YourProject' and Status = 'ON HOLD'") | |
if err != nil { | |
log.Fatal(err) | |
} | |
for _, issue := range issues { | |
if issue.Key == "MyIssueKey" { | |
transition, err := getIssueTransition(client, issue, "In Progress") | |
if err != nil { | |
log.Fatal(err) | |
} | |
// Perform transition | |
err = transitionIssue(client, issue, transition) | |
if err != nil { | |
log.Fatal(err) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment