feat: outgoing webhooks
Owners and admins can point a project at other systems: a signed JSON POST (HMAC-SHA256 of the body) when tickets, comments, releases or sprints change, filtered by event or family. Deliveries are retried a couple of times, the last one is shown, and a ping can be sent from the settings. Private addresses are refused unless WEBHOOKS_ALLOW_PRIVATE is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -190,6 +190,13 @@ input CreateSprintInput {
|
||||
startDate: String!
|
||||
}
|
||||
|
||||
input CreateWebhookInput {
|
||||
"""Event names, family.* or *"""
|
||||
events: [String!]!
|
||||
projectId: ID!
|
||||
url: String!
|
||||
}
|
||||
|
||||
type CreatedResolved {
|
||||
created: Int!
|
||||
resolved: Int!
|
||||
@@ -465,6 +472,7 @@ type Mutation {
|
||||
|
||||
"""Plan a sprint (owners and admins)"""
|
||||
createSprint(input: CreateSprintInput!): CommandResult!
|
||||
createWebhook(input: CreateWebhookInput!): WebhookCreated!
|
||||
|
||||
"""Author or project admin"""
|
||||
deleteComment(commentId: ID!): CommandResult!
|
||||
@@ -479,6 +487,7 @@ type Mutation {
|
||||
|
||||
"""Delete a sprint that never started; its tickets go back to the backlog"""
|
||||
deleteSprint(sprintId: ID!): CommandResult!
|
||||
deleteWebhook(webhookId: ID!): Boolean!
|
||||
disableGitIntegration(projectId: ID!): Boolean!
|
||||
editComment(body: String!, commentId: ID!): CommandResult!
|
||||
|
||||
@@ -522,6 +531,9 @@ type Mutation {
|
||||
|
||||
"""Start a planned sprint (only one under way per project)"""
|
||||
startSprint(sprintId: ID!): CommandResult!
|
||||
|
||||
"""Send a ping now and tell how it went"""
|
||||
testWebhook(webhookId: ID!): WebhookDelivery!
|
||||
unlinkIssues(input: LinkIssuesInput!): CommandResult!
|
||||
|
||||
"""Stop following a ticket"""
|
||||
@@ -539,6 +551,7 @@ type Mutation {
|
||||
updateProjectSettings(projectId: ID!, settings: ProjectSettingsInput!): CommandResult!
|
||||
updateRelease(input: UpdateReleaseInput!): CommandResult!
|
||||
updateSprint(input: UpdateSprintInput!): CommandResult!
|
||||
updateWebhook(input: UpdateWebhookInput!): Webhook!
|
||||
|
||||
"""
|
||||
Follow a ticket: be told when it moves, is reassigned or gets a comment
|
||||
@@ -776,6 +789,10 @@ type Query {
|
||||
|
||||
"""Search users by name or email (to assign / add members)"""
|
||||
users(limit: Int! = 20, search: String! = ""): [User!]!
|
||||
|
||||
"""Event names a webhook can subscribe to (also family.* and *)"""
|
||||
webhookEvents: [String!]!
|
||||
webhooks(projectId: ID!): [Webhook!]!
|
||||
}
|
||||
|
||||
input RankIssueInput {
|
||||
@@ -1053,6 +1070,13 @@ input UpdateSprintInput {
|
||||
startDate: String
|
||||
}
|
||||
|
||||
input UpdateWebhookInput {
|
||||
active: Boolean
|
||||
events: [String!]
|
||||
url: String
|
||||
webhookId: ID!
|
||||
}
|
||||
|
||||
"""User managed by the Pireon identity server"""
|
||||
type User {
|
||||
email: String!
|
||||
@@ -1066,6 +1090,39 @@ type UserRef {
|
||||
name: String!
|
||||
}
|
||||
|
||||
"""
|
||||
Where the project tells another system what happened (signed POST, HMAC-SHA256)
|
||||
"""
|
||||
type Webhook {
|
||||
active: Boolean!
|
||||
createdAt: String!
|
||||
createdBy: UserRef!
|
||||
|
||||
"""Event names, family.* or *"""
|
||||
events: [String!]!
|
||||
id: ID!
|
||||
lastDelivery: WebhookDelivery
|
||||
projectId: ID!
|
||||
url: String!
|
||||
}
|
||||
|
||||
type WebhookCreated {
|
||||
id: ID!
|
||||
|
||||
"""Signs every delivery. Shown only now: keep it."""
|
||||
secret: String!
|
||||
}
|
||||
|
||||
type WebhookDelivery {
|
||||
at: String!
|
||||
error: String
|
||||
event: String!
|
||||
ok: Boolean!
|
||||
|
||||
"""HTTP status"""
|
||||
status: Int
|
||||
}
|
||||
|
||||
type WorkflowStatus {
|
||||
"""No new tickets or transitions into it"""
|
||||
archived: Boolean!
|
||||
|
||||
Reference in New Issue
Block a user