wulf-pulse/scripts/check-suspect-tickets.ts
lorentz 672f17b7f9 chore: check in pending work — queue preferences, QBO AR diagnostics, mobile engagement fixes, ops scripts
Bundles several in-progress efforts that were sitting uncommitted:
- User queue-preferences (migration 087, API route, popover component)
- QBO invoice soft-delete (migration 088) and AR diagnostics route
- Dashboard/mobile engagement route and page adjustments
- Docker Compose log-rotation config
- One-off ticket/RMM investigation scripts (scripts/)
- Planning docs: phase verification/pattern notes, mobile shell design spec
- .gitignore: exclude local scratch financial/inventory data and Claude Code
  worktree/local-settings runtime state (never meant for version control)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6RuWdiUiXrPK6FLBHjtpY
2026-07-18 06:34:57 -04:00

31 lines
1.1 KiB
TypeScript

import { config } from 'dotenv';
import { resolve } from 'path';
config({ path: resolve(__dirname, '../.env.local') });
const SUSPECTS = [573672, 568742, 541321, 532302];
const headers = {
Username: process.env.AUTOTASK_USERNAME!,
Secret: process.env.AUTOTASK_SECRET!,
APIIntegrationcode: process.env.AUTOTASK_API_INTEGRATION_CODE!,
Accept: 'application/json',
};
async function main() {
for (const id of SUSPECTS) {
const res = await fetch(`${process.env.AUTOTASK_API_URL}/Tickets/${id}`, { headers });
const data = await res.json();
const t = data.item;
if (!t) {
console.log(`Ticket ${id}: NOT FOUND IN AUTOTASK`);
continue;
}
console.log(`Ticket ${id} (${t.ticketNumber}):`);
for (const f of ['title','purchaseOrderNumber','ticketNumber','changeInfoField1','changeInfoField2','changeInfoField3','changeInfoField4','changeInfoField5']) {
const v = t[f];
const len = typeof v === 'string' ? v.length : 0;
if (len > 0) console.log(` ${f.padEnd(24)} len=${len}${len > (f === 'purchaseOrderNumber' || f === 'ticketNumber' ? 100 : 255) ? ' << OVERFLOW' : ''}`);
}
}
}
main().catch(console.error);