[Feature][Webhook] Allow closing incidents via request body (fixes #8910)#8921
Open
bujjibabukatta wants to merge 1 commit into
Open
[Feature][Webhook] Allow closing incidents via request body (fixes #8910)#8921bujjibabukatta wants to merge 1 commit into
bujjibabukatta wants to merge 1 commit into
Conversation
Contributor
Author
|
Hi @klesh could you please review and approve the PR? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8910
Kibana v8.x webhook connectors require a fixed URL per connector and
cannot dynamically construct URLs using alert context values. This made
it impossible to implement a "create + close" incident workflow in Kibana
because the existing close endpoint requires
issueKeyin the URL path.Changes
Added two new endpoints that accept
issueKeyin the JSON request bodyinstead of the URL path, while keeping all existing endpoints untouched
for full backward compatibility.
New endpoints
POST /connections/:connectionId/issue/closeCloseIssueByBodyPOST /connections/by-name/:connectionName/issue/closeCloseIssueByBodyByNameFiles changed
backend/plugins/webhook/api/issues.go— addedCloseIssueByBodyRequeststruct,CloseIssueByBodyandCloseIssueByBodyByNamehandlersbackend/plugins/webhook/impl/impl.go— registered 3 new routes (including legacy prefix variant)How it works
Both new handlers decode
issueKeyfrom the request body and inject itinto
input.Params["issueKey"]before delegating to the existing sharedcloseIssue()helper — zero business logic duplicated.Usage (Kibana or any fixed-URL client)
Notes
/issue/closepriority over wildcard
/issue/:issueKey/closemake swagType of change