Skip to content

APIObject for teams in EscalationPolicy?Β #517

@fchiron

Description

@fchiron

Hi πŸ‘‹

I'm trying to list escalation policies and get the id and summary of their team, and I noticed EscalationPolicy.Teams is a slice of APIReference (here), so it only contains the team id, not the summary.

However, when looking at the JSON payload of the GET /escalation_policies and GET /escalation_policies/{id} endpoints, I noticed the teams attribute looks like an array of APIObjects, the summary, self, and html_url attributes are there, for example:

{
  // ...
  "teams": [
    {
      "id": "PJ9K5JH",
      "type": "team_reference",
      "summary": "Incident Management",
      "self": "https://api.pagerduty.com/teams/PJ9K5JH",
      "html_url": "https://datadog.pagerduty.com/teams/PJ9K5JH"
    }
  ],
  // ...
}

Would it be possible to make EscalationPolicy.Teams a []APIObject instead of []APIReference? Maybe I'm missing something and it wouldn't work in some cases.

For use cases like mine (getting the escalation policy's team name), it would avoid an extra API call since the information is already there. Currently, as a workaround I think I'll need either to implement something custom using .Do(), or make extra API calls to the teams API endpoint.

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