Fix STPL_AMER.sh: Add missing SLA parsing and save raw data

Problem

STPL_AMER.sh is missing the SLA normalization step that STPL.sh (EMEA) has. Zendesk returns verbose SLA strings (e.g. 2 hours till breach2hApril 23, 2026 11:26), and without extracting the compact value, the raw strings fail every downstream regex match (^([0-9]+)([mhd])$).

This causes:

  • Priority 1: empty - is_within_3_hours() regex never matches, so no New tickets are captured
  • Priority 3: empty - is_within_business_hours() regex never matches
  • Priority 4: misclassified - tickets that should be P3 fall through to P4
  • Sort ordering broken - get_sla_sort_value() returns empty values

Verified with real data

Priority Expected (with fix) Actual on main (broken)
P1 712911 (63m), 712930 (2h) None
P2 712364 (-17h), 707208 (8h) 712364, 707208 (correct)
P3 712958 (8h) None
P4 712959 (24h) 712959, 712958 (misclassified)

Fix

  1. Tidy SLA values after field splitting (matching STPL.sh): extracts compact SLA like 3h, -17h, 63m from verbose Zendesk strings
  2. Save raw data to all_data.txt for debugging (matching STPL.sh)
  3. Add checkbox formatting to Claude prompt: - [ ] before each numbered ticket, with continuous numbering across priority groups
Edited by Indira Nefedova

Merge request reports

Loading