Aging Work Items Alert prompt
Use case
Catch stuck work before it becomes a crisis. Instead of manually scanning boards every morning, get a glance that tells you where to focus.
Personas: Engineering Lead, Scrum Master, Agile Coach
Context: Viz
Prompt text
Copy and paste the following text into the Anvi Chat window.
Use AGGREGATIONS (not individual item fetches) to count items by product, artifact type, flow state, and age bucket. IMPORTANT: Return ALL products in current scope, not just the first batch. Set aggregation bucket size to at least 1000 to ensure all products are included. For each product and artifact type in New, Active, or Waiting flow state where age is not null, AGGREGATE: - product_name (the display name) - artifact_type (the source system work item type, as it appears in the data) Use a single aggregation query with composite/nested buckets to count: - By flow_state: New, Active, Waiting - By age range: 0-14d, 14-30d, 30-90d, 90-180d, 180d-1yr, >1yr Do NOT fetch individual items. Use "size": 0 with aggregations to get counts directly. Use bucket size of at least 1000 for the product aggregation to capture all products. For each product/artifact_type combination, the aggregation should return: - Count in New flow state where age is not null - Count in Active flow state where age is not null - Count in Waiting flow state where age is not null - Count where age >= 0 and age < 14 days - Count where age >= 14 and age < 30 days - Count where age >= 30 and age < 90 days - Count where age >= 90 and age < 180 days - Count where age >= 180 and age < 365 days - Count where age >= 365 days These age ranges are mutually exclusive — no double counting. New + Active + Waiting must equal the sum of age columns. The oldest item MUST come from the same portfolio scope as the table above. Do not query outside the selected portfolio. Identify the single oldest item in New, Active, or Waiting state (product, name, and age in days). This is the ONLY place where you should fetch an individual item. OUTPUT FORMAT: <template> ## Work Items Aging Report | Product | Artifact Type | New | Active | Waiting | 0-14d | 14-30d | 30-90d | 90-180d | 180d-1yr | >1yr | |---------|---------------|-----|--------|---------|-------|--------|--------|---------|----------|------| | [Product Name] | [Type] | [count] | [count] | [count] | [count] | [count] | [count] | **[count]** | **[count]** | **[count]** | *Sort rows by: Product name, then Artifact type* --- **Drill into details:** [Open Viz](https://viz.tasktop.net) to explore aging work items. --- **⚠️ Oldest Item:** [Product] — [Item name] — [X] days old --- </template>

