Skip to content

Conversation

itsnewtjam
Copy link

This addresses issue #156

Supports attaching multiple components when creating an incident via API:

{
  "name": "<string>",
  "status": 0,
  "message": "<string>",
  "template": "<string>",
  "visible": false,
  "stickied": false,
  "notifications": false,
  "occurred_at": "<string>",
  "template_vars": [],
  "components": [
    {
      "component_id": 123,
      "component_status": 1
    },
    // etc...
  ]
}

Also:

  • pulls the first component for the component template variable, just in case :)
  • removes associated rows in the incident_components table when an incident is deleted

Copy link
Member

@jbrooksuk jbrooksuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work, thanks @itsnewtjam. Could you please add a test case for this and then we can get it merged.

@itsnewtjam
Copy link
Author

@jbrooksuk Test added! Not sure why the CreateMetricPoint test failed in the checks though, seems unrelated and it's passing fine locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants