Updating custom details via rest api?

Hi,

I tried to update custome fields to an incident (which i created via events API).

Then I call:
curl -X PUT --header ‘Content-Type: application/json’ --header ‘Accept: application/vnd.pagerduty+json;version=2’ --header ‘From: x@x.com’ --header ‘Authorization: Token token=xxxxxxxxx’ -d ‘{
“incident”: {
“type”: “incident_reference”,
“status”: “acknowledged”,
“custom_details”: {
“actionPlan”: “actionplan v2”
}
}
}’ ‘https://api.pagerduty.com/incidents/xxxxxx

…also versions with a “payload” element… in both cases

  • while the API result is 200,
  • the changed values are not visible in the incident UI … and
  • incident/get does not list them.

Any ideas how I can update custom details with Event API?

Kind regards,

Daniel

I believe you want to update the alert: https://api-reference.pagerduty.com/#!/Incidents/put_incidents_id_alerts_alert_id
as I don’t think it’s the incident that contains the custom_details, but rather the triggered alert contained in the incident. Something like:

{
  "alert": {
    "type": "alert",
    "body": {
      "type": "alert_body",
      "details": {
        "actionPlan": "actionplan v2"
      }
    }
  }
}

If you only have the incident ID and not the alert ID, you can find the alerts for the incident with https://api-reference.pagerduty.com/#!/Incidents/get_incidents_id_alerts