🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

[Bug][Webhook] Incident closing via webhook does not set resolution_date #8906

Closed

Description

@jvgr019

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When closing an incident via webhook, the incident does not appear to be properly marked as resolved in the database.
Failed deployment recovery time needs resolved_date to calculate metric

What do you expect to happen

When an incident is resolved via webhook, FDRT should reflect the correct recovery time

How to reproduce

  • Create an incident in DevLake by webhook

curl --location 'http://localhost:4000/api/rest/plugins/webhook/connections/3/issues' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer XXXXXXXX' \ --data '{ "issueKey":"202606031000", "title":"Issue from webhook", "type":"INCIDENT", "originalStatus":"CREATED", "status":"IN_PROGRESS", "createdDate":"2026-06-03T08:00:00+00:00" }'

  • Look at incidents table how record is created with created_date field filled with createdDate from body
Image
  • Close the incident
    curl --location --request POST 'http://localhost:4000/api/rest/plugins/webhook/connections/3/issue/202606031000/close' \ --header 'Authorization: Bearer XXXXXXXX'

  • Response is Ok 200
    { "code": 0, "success": true, "message": "success", "causes": null, "data": null }

  • Look at incidents table how record created previously not fill resolution_date

Image
  • At Dora dashboard FDRT show no data
Image
  • Update incident resolution_date field into database
    update incidents set resolution_date = '2026-06-03 09:30:00' where id = 'webhook:3:202606031000'
  • At Dora dashboard FDRT data is shown
Image

Anything else

No response

Version

v1.0.3-beta12@1d21f19

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    type/bug
    on Jun 4, 2026
  2. pavankadabala-png commented on Jun 12, 2026

    @pavankadabala-png

    I had a look through the webhook plugin code to figure out why this is happening.

    In backend/plugins/webhook/api/issues.go, the closeIssue function (the one behind POST /plugins/webhook/:connectionId/issue/:issueKey/close) sets Status to DONE and clears OriginalStatus for both the issue and the incident record, but it never sets ResolutionDate. The DORA FDRT metric is calculated from incidents.resolution_date, so an incident closed this way just never shows up in that dashboard - which lines up with what you found, and why manually updating resolution_date in the DB fixes it.

    I think the fix is pretty contained: when closeIssue sets status to DONE, it should also set ResolutionDate to the current time if it's not already set (for both the issue and incident records), and recalculate LeadTimeMinutes the same way postIssue already does.

    I'd be glad to put a PR together for this if no one's working on it yet. Let me know if that approach makes sense, or if you'd rather allow the resolution date to be passed in explicitly on the close call instead of just defaulting to now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions