# Reports — Work Analytics

> Report work hours across multiple projects at once

Global work reports with filtering by projects, users, sprints, and date ranges. PDF export for stakeholders. Separate tracking of AI vs. manual entries.

## Features

- **Cross-project aggregation**: Single view of reports across all projects. Superuser sees everything, project member sees only their projects.
- **Multi-select filters**: Select multiple projects, users, and sprints at once. Date range defaults to last 30 days.
- **Statistics**: Total hours, average per entry, unique user count, AI vs. manual entry breakdown.
- **PDF export**: Formatted report generated server-side with weasyprint. Ready to send to stakeholders.
- **Entry table**: User, ticket key (PIM-1), sprint, date, hours, description. Pagination at 20 entries.
- **AI entry detection**: created_via_ai flag on each entry. Separate counters for AI and manual entries.

## How it works

1. **Open Reports**: Reports dashboard is global — no project selection needed. Accessible from main navigation.
2. **Set filters**: Choose projects, users, and sprints. Default: all projects, last 30 days.
3. **Review statistics**: Summary at the top: total hours, average, users, AI/manual breakdown.
4. **Export to PDF**: Click the export button — report generates server-side and downloads as PDF.

## AI and MCP

Reports aggregate data logged via the log_time tool in the Scrum module. AI agent logs work time via MCP — entries automatically marked as AI-created.

- `log_time`: Log work time to a ticket (in the Scrum module). Entry marked as AI-created.
- `list_tickets`: Browse tickets with logged time
- `get_ticket`: Ticket details with time entries list

## Technical details

- **Aggregation**: Service layer aggregates hours per project, sprint, and user. Filters validated against permissions.
- **PDF**: weasyprint generates PDF server-side. CSS styling in HTML template.
- **AI detection**: created_via_ai flag on TimeTrackingEntry model. MCP entries automatically flagged.
- **Permissions**: Superuser sees all projects. Member sees only projects they belong to.
