Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIObject for teams in EscalationPolicy? #517

Open
fchiron opened this issue Mar 7, 2024 · 0 comments
Open

APIObject for teams in EscalationPolicy? #517

fchiron opened this issue Mar 7, 2024 · 0 comments

Comments

@fchiron
Copy link

fchiron commented Mar 7, 2024

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.

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

No branches or pull requests

1 participant