Teams selector alongside projects selector.
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 10m
- Merged PRs (30d)
- 635
Description
### Problem Statement
As a member of multiple teams, I often encounter a situation where I would like to select all projects within a given team. This applies to many views like Issues, Insights, Traces, Logs, etc. At the moment, the only view that supports this is the Alerts view.
Using a query filter for searching assigned issues is not the same because not all issues are assigned, or they are assigned to specific users. This also does not solve the issue for other types of data like spans or logs.
Using saved views or saved queries is a workaround, but those have to be updated every time a new project is added, which becomes problematic with larger numbers of projects and views or queries.
Related to: [https://github.com/getsentry/sentry/issues/45367](), but that one only requests this for issues.
### Solution Brainstorm
Add the `TeamPageFilter` component to all FilterBars. This component should include the teams that the user belongs to or has access to (in the case of admin users) and send an array of teams (`queryparam:team`) if selected, just like the project filter does.
[https://github.com/getsentry/sentry/blob/07eb7a58964b2f676427d04ebdb0509fb900b184/static/app/views/issueList/filters.tsx#L26-L30]()
Modify `get_projects` to also check the `team` query param and scope projects based on it, for example:
* if both project and team filters are selected, return only the subset of both (this is how it works on the Alerts page at the moment)
* if no projects are selected but teams are, return only projects from the selected teams that the user has access to
[https://github.com/getsentry/sentry/blob/07eb7a58964b2f676427d04ebdb0509fb900b184/src/sentry/api/bases/organization.py#L362-L392]()
### Product Area
Contributor guide
Research direction
Start with static/app/views/issueList/filters.tsx to understand how TeamPageFilter is used, then inspect src/sentry/api/bases/organization.py around get_projects. Identify the FilterBars that need the team selector and verify the project scope behavior for team-only and combined project-and-team filters. Done means the relevant views support team selection and return only accessible projects matching the selected teams.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- api, backend, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100