[API] statsPeriod parameter not respected in list project's issues endpoint
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
- List all issues in a project using this endpoint: https://docs.sentry.io/api/events/list-a-projects-issues/
Expected Result
When omiting statsPeriod the response will show stats for the organisation's retention as detailed in the documentation:
An optional stat period (can be one of "24h", "14d", and ""). If not provided, the API will return the max time period for the project (90 days for paid accounts, 30 days for free).
GET https://sentry.io/api/0/projects/dev-curumas/notjava/issues/
"id": "5686141479",
....
"stats": {
"90d": [
...
]
}
Actual Result
The endpoint returns 24h stats instead of 90d as described in the documentation. For example: GET https://sentry.io/api/0/projects/dev-curumas/notjava/issues/
"id": "5686141479",
....
"stats": {
"24h": [
...
]
}
Setting it to 14d returns the expected information: GET https://sentry.io/api/0/projects/dev-curumas/notjava/issues/?statsPeriod=14d
"id": "5686141479",
....
"stats": {
"14d": [
...
]
}
Product Area
APIs
Link
No response
DSN
No response
Version
No response
Assigning to @getsentry/support for routing ⏲️
Routing to @getsentry/product-owners-apis for triage ⏲️
The doc has now changed to
he statsPeriod parameter can be used to select the timeline stats which should be present. Possible values are: "" (disable),"24h" (default), "14d"
And no matter the value, it always returns a 90D period. Note we are on a paid account.
Routing to @getsentry/product-owners-issues for triage ⏲️
@13013SwagR can you confirm you're using the project issues endpoint and not the undocumented organization issues endpoint?
@mrduncan We were using projects/<org>/<project>/issues/, but we learned that the statsPeriod parameter actually filters the events on each issue and that the endpoint always returns issues from the last 90 days...
To get issues from the last 14 days, for example, we had to use organizations/<org>/issues/ and use the project filter. This returned issues from the defined statsPeriod
@13013SwagR This is helpful info, thanks! We can work on getting the docs to explain better what it controls.