
๐ฌNotification Schemes
Get Notification schemes
package main
import (
"context"
"fmt"
_ "github.com/ctreminiom/go-atlassian/v2/jira/v2"
"github.com/ctreminiom/go-atlassian/v2/jira/v3"
"github.com/ctreminiom/go-atlassian/pkg/infra/models"
"log"
"os"
)
func main() {
var (
host = os.Getenv("HOST")
mail = os.Getenv("MAIL")
token = os.Getenv("TOKEN")
)
jira, err := v3.New(nil, host)
if err != nil {
return
}
jira.Auth.SetBasicAuth(mail, token)
jira.Auth.SetUserAgent("curl/7.54.0")
options := &models.NotificationSchemeSearchOptions{
NotificationSchemeIDs: []string{"10000"},
ProjectIDs: nil,
OnlyDefault: false,
Expand: nil,
}
notificationSchemes, response, err := jira.NotificationScheme.Search(context.Background(), options, 0, 50)
if err != nil {
if response != nil {
log.Println("Response HTTP Response", response.Bytes.String())
}
log.Fatal(err)
}
for _, notificationScheme := range notificationSchemes.Values {
fmt.Println(notificationScheme)
}
}Create Notification scheme
Get Project notification schemes
Get Notification scheme
Update Notification scheme
Delete Notification scheme
Append Notifications to scheme
Remove Notifications to scheme
Last updated
Was this helpful?