collabSupport/services/jiraPoller/README.md
jmcqueen a25fc08fe2 Rename /voicereport to /callreport with scoped user and phone targets.
Add store/email/phone filtering, richer call-line formatting, CDR feed pagination and queueing, and split Jira poller enrichment into testable modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 10:10:03 -04:00

2.4 KiB

Jira poller enrichment

Hourly automation that enriches unassigned Jira tickets with CollabFinder command output posted as ADF comments. Orchestrated by services/jiraPollerService.js; scheduled in index.js when JIRA_POLLER_ROOM_ID is set.

Flow

JQL search → classifyTicket (AI) → resolveEnrichmentPlan (rules)
  → runEnrichmentChecks (collectors + renderers) → Jira ADF comment
  → label bot-enriched → Webex summary

Idempotency uses Jira labels (bot-enriched, bot-skipped), not local state. Transient failures leave the ticket unlabeled for retry next hour.

Communication Services symptom rules

For tickets with component Communication Services and a resolvable store:

Symptom keywords Checks run
Call quality / connectivity (garbled, static, can't connect, …) phonestatus + callreport
Spam / robocall / nuisance callreport only
Neither Default: phone → phonestatus, av → avstatus

callreport uses the today business window (9am local → now minus 5 min).

Store number comes from the AI classifier; if missing but a symptom rule matched, the planner falls back to Store NNNN in the summary.

Adding a new symptom rule

  1. Open enrichmentRules.js.
  2. Add regex patterns to CALL_QUALITY_PATTERNS, SPAM_PATTERNS, or a new pattern list.
  3. Extend resolveEnrichmentPlan() to push a rule id into matchedRules and append check ids to checks.
  4. Add tests in tests/jiraPoller.enrichmentRules.test.js.

Adding a new enrichment check

  1. Register the check in CHECK_IDS and CHECK_RUNNERS in runEnrichment.js (collector + renderer, same as the chat command).
  2. Reference the new check id from a rule in enrichmentRules.js.
  3. Add tests in tests/jiraPoller.runEnrichment.test.js.

Manual trigger

/jirapoll          run poller now
/jirapoll prime    label backlog without enriching (one-time adoption)

Environment

Variable Purpose
JIRA_POLLER_ROOM_ID Webex room for hourly summary + enables cron
JIRA_STORE_FIELD_ID Pin Store Number custom field id
JIRA_POLLER_MODEL Override X.AI model for classification
CDR_FEED_COOLDOWN_MS cdr_feed rate limit (default 65000) for callreport

See .env.example for full Jira poller section.