1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-08-06 22:13:02 +02:00

Add: Organization Webhook API [HX-822] (#11)

 Add: Organization Webhook API
This commit is contained in:
Karan Jagtiani
2021-12-16 14:29:46 +05:30
committed by GitHub
parent 66f3331bee
commit 5e62a2d0c0
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,40 @@
package main
import (
"context"
"encoding/json"
"fmt"
"strings"
jira "github.com/interviewstreet/go-jira"
)
func main() {
jiraURL := ""
username := ""
token := ""
tp := jira.BasicAuthTransport{
Username: username,
Password: token,
}
client, err := jira.NewClient(tp.Client(), strings.TrimSpace(jiraURL))
if err != nil {
fmt.Printf("\nerror: %v\n", err)
return
}
ctx := context.TODO()
webhooks, _, err := client.Organization.GetWebhookList(ctx)
pretty, _ := json.MarshalIndent(webhooks, "", " ")
fmt.Println(string(pretty))
if err != nil {
fmt.Printf("\nerror: %v\n", err)
return
}
}