Skip to content

tags field appends wrong datatype and the alert is being rejected by OpsGenie API #29

Description

@epierotto

Using the snippet example:

{
  "opsgenie": {
    "customerKey": "the-key",
    "teams": ["teams"],
    "recipients": "the-recipients",
    "source": "alert-source",
    "overwrite_quiet_hours": true,
    "tags": ["sensu"]
  }
}

Tags is an array of strings and in this line it's appending the config['opsgenie']['tags'] into tags array

Which creates:
"tags":[["sensu"],"OverwriteQuietHours","critical"]

It should be:
tags + json_config['tags'] if json_config['tags']

Alerts are rejected by OpsGenie API with the message:
HTTP 422 Unprocessable Entity

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions