# Support Insights Digest

Pull ticket data from the org's helpdesk, aggregate volume, top drivers, and CSAT (customer satisfaction score) into a weekly report, then distribute it to stakeholders.

## When to use

- A recurring weekly (or other periodic) summary of support ticket volume, root-cause drivers, and CSAT is needed.
- Leadership or the support team wants a digestible digest instead of raw helpdesk exports.
- Trends in ticket categories or satisfaction scores need surfacing without manual spreadsheet work.

## Tools

- `http-get`
- `shell-execute`
- `write-file`
- `send-email`

## Playbook

1. Confirm the reporting window (e.g. the last 7 days) and the helpdesk host to query, using the org's designated support system.
2. Call `http-get` against the helpdesk REST API to pull raw ticket data, e.g. `GET https://api.helpdesk.example.com/v1/tickets?created_after=<date>`. Auth is injected by the org's Integration row for this host — never ask for, echo, or hardcode credentials.
3. If ticket volume is paginated, repeat `http-get` calls following the API's pagination links until all tickets in the window are retrieved.
4. Call `http-get` again for CSAT survey results tied to the same window, e.g. `GET https://api.helpdesk.example.com/v1/satisfaction_ratings?created_after=<date>`.
5. Use `shell-execute` to run a scripted analysis pass over the pulled data (counting tickets by category/driver, computing average CSAT, identifying week-over-week deltas).
6. Use `write-file` to save the aggregated report as a structured document (e.g. markdown or CSV) in the location the org designates for reports.
7. Answer any driver classification strictly from the org knowledge base categories already present in the ticket data — never invent new policy or root-cause labels not backed by the source data.
8. Use `send-email` to distribute the finished digest to the configured stakeholder list, attaching or linking the report produced by `write-file`.
9. If the helpdesk API returns a 401/403, or no Integration row exists for the host, stop and message a human via `send-message` naming the service and the scopes required.

## Failure modes

- Helpdesk API pagination is mishandled, producing an undercount of tickets or missing days in the window.
- CSAT scores are averaged incorrectly (e.g. mixing unanswered surveys into the denominator), skewing the reported satisfaction trend.
- The digest email is sent to an outdated or misconfigured stakeholder list, so intended recipients never see the report.
- A driver or category is inferred beyond what the raw ticket data supports, fabricating a root cause not present in the org knowledge base.

## Done when

- Ticket volume, top drivers, and CSAT for the full reporting window are aggregated and written to a report file via `write-file`.
- The digest has been sent to stakeholders via `send-email` with accurate figures traceable back to the raw helpdesk data.
- Any data-access failures (auth errors, missing Integrations) were escalated to a human rather than silently skipped.
</content>