You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][Opsgenie] Closed incidents are converted to status OTHER without a resolution date #9388
I had searched in the issues and found no similar issues.
What happened
The Opsgenie convertIncidents subtask (plugins/opsgenie/tasks/incidents_converter.go) maps closed incidents to OTHER and leaves them without a resolution date.
Opsgenie incidents have three statuses, open, resolved and closed (models.IncidentStatus*). A closed incident is finished, the same as a resolved one, but the converter treats it as neither open nor done:
and getTimes only sets resolution_date and lead_time_minutes for resolved.
So every closed Opsgenie incident ends up in issues with status = 'OTHER', resolution_date = NULL and lead_time_minutes = NULL. Metrics that use the resolution date, such as DORA's failed deployment recovery time, leave closed incidents out, and they don't count as done in issue status breakdowns.
What do you expect to happen
Closed incidents are converted like resolved ones: status = 'DONE', with resolution_date and lead_time_minutes set from the incident's updatedAt, as is already done for resolved incidents. original_status keeps closed.
How to reproduce
Close an incident in Opsgenie (or have one with "status": "closed" in _raw_opsgenie_incidents).
Collect the Opsgenie service and run the convert incidents subtask.
The incident's row in issues has status = OTHER and no resolution_date / lead_time_minutes.
Anything else
Proposed fix (I have a PR ready): treat closed like resolved in getStatus and getTimes, with unit tests for both.
Activity