Package webhook

import "github.com/matrix-org/go-neb/services/jira/webhook"

Overview ▾

func OnReceiveRequest

func OnReceiveRequest(req *http.Request) (string, *Event, *errors.HTTPError)

OnReceiveRequest is called when JIRA hits NEB with an update. Returns the project key and webhook event, or an error.

func RegisterHook

func RegisterHook(jrealm *jira.Realm, projects []string, userID, webhookEndpointURL string) error

RegisterHook checks to see if this user is allowed to track the given projects and then tracks them.

type Event

type Event struct {
    WebhookEvent string       `json:"webhookEvent"`
    Timestamp    int64        `json:"timestamp"`
    User         gojira.User  `json:"user"`
    Issue        gojira.Issue `json:"issue"`

Event represents an incoming JIRA webhook event