Skip to content

[Bug][Opsgenie] Closed incidents are converted to status OTHER without a resolution date #9388

Open

Description

@ShivamSharma43

Search before asking

  • 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:

func getStatus(incident *models.Incident) string {
	if incident.Status == models.IncidentStatusClosed {
		return ticket.OTHER
	}
	...
	if incident.Status == models.IncidentStatusResolved {
		return ticket.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

  1. Close an incident in Opsgenie (or have one with "status": "closed" in _raw_opsgenie_incidents).
  2. Collect the Opsgenie service and run the convert incidents subtask.
  3. 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.

Version

main

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions