bujjibabukatta opened a new pull request, #8921:
URL: https://github.com/apache/devlake/pull/8921

   ## 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 `issueKey` in the URL path.
   
   ## Changes
   
   Added two new endpoints that accept `issueKey` in the JSON request body 
   instead of the URL path, while keeping all existing endpoints untouched 
   for full backward compatibility.
   
   ### New endpoints
   
   | Endpoint | Handler | issueKey source |
   |---|---|---|
   | `POST /connections/:connectionId/issue/close` | `CloseIssueByBody` | JSON 
body |
   | `POST /connections/by-name/:connectionName/issue/close` | 
`CloseIssueByBodyByName` | JSON body |
   
   ### Files changed
   
   - `backend/plugins/webhook/api/issues.go` — added `CloseIssueByBodyRequest` 
struct, `CloseIssueByBody` and `CloseIssueByBodyByName` handlers
   - `backend/plugins/webhook/impl/impl.go` — registered 3 new routes 
(including legacy prefix variant)
   
   ## How it works
   
   Both new handlers decode `issueKey` from the request body and inject it 
   into `input.Params["issueKey"]` before delegating to the existing shared 
   `closeIssue()` helper — zero business logic duplicated.
   
   ## Usage (Kibana or any fixed-URL client)
   
   ```bash
   # Before (broken in Kibana — issueKey in URL, can't be dynamic)
   POST /plugins/webhook/connections/1/issue/DLK-1234/close
   
   # After (works in Kibana — fixed URL, issueKey in body)
   POST /plugins/webhook/connections/1/issue/close
   Content-Type: application/json
   
   {
     "issueKey": "DLK-1234",
     "resolutionDate": "2026-06-13T10:00:00Z"
   }
   ```
   
   ## Notes
   
   - No breaking changes — all existing path-based endpoints remain untouched
   - Route conflict is not an issue: Gin gives static segment `/issue/close` 
     priority over wildcard `/issue/:issueKey/close`
   - Swagger docs regenerated via `make swag`
   
   ## Type of change
   
   - [x] New feature (non-breaking)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to