Skip to main content

Scenario

Marketing needs to know when features will actually ship — not the optimistic roadmap date, but a timeline grounded in engineering velocity. This job pulls Linear cycle history (completed story points per cycle), calculates velocity trends and remaining capacity, then sends the analysis to Mave Agent for a marketing launch timeline aligned with engineering reality. Flow: Linear GraphQL (cycles with completedIssueCountHistory) → calculate velocity → Mavera POST /api/v1/mave/chat → Marketing timeline

Code

Example Output

Error Handling

Cycles without estimates return empty completedScopeHistory. Enable estimates in Linear (Settings → Teams → Estimation) for accurate velocity tracking.
Linear auto-names cycles by date range. The code uses number as identifier. Adjust if your team uses custom names.
Holidays or crunch sprints skew averages. The code uses the last 6 cycles — consider trimming the highest and lowest values for robustness.