# Team Workflow Cronjobs

Automated tasks for TCOC (TiDB Cloud Operations Center) reporting and oncall record management.

## Cronjobs

| Job | Schedule | Description |
|-----|----------|-------------|
| daily-task-sync | UTC 10:00 | Daily sync of TCOC tasks |
| daily-oncall-sync | UTC 00:00 | Daily oncall record sync from Jira to Bitable |
| weekly-ticket-report | UTC 01:30 Thu / UTC+8 09:30 Thu | Weekly TCOC report generation |
| ai-news | UTC 09:00 daily | Daily AI news aggregation |
| bi-weekly-ai-news | UTC 09:00 Mon,Thu | Bi-weekly AI news |
| weekly-tidb-competitor | UTC 09:00 Mon | Weekly TiDB competitor analysis |

## Scripts

### daily-oncall-sync
Queries Jira for TCOC and O11Y (Critical Alerts) from the past 2 days and syncs to Feishu Bitable.

**JQL Filters:**
- TCOC: `project=TCOC AND created >= {date} AND component IN (BR, Cloud DM, Cloud Import, TiCDC)`
- O11Y: `project=O11Y AND priority=Critical AND component IN (br, import-controller, tcidm-regional, ticdc, ticdc-kernel) AND type=Task AND "Engineer Leader" != 623304991c09d2007014ce4f`

**Bitable:**
- App Token: DK5Ib7kmAadIoWsUV8tczRmwnkh
- Table: FY26- Data Service Oncall Records (tblnZt7BJBTzYMvJ)

## Configuration

Environment variables required (in `~/.bashrc`):
- `JIRA_USER` - Jira email
- `JIRA_API_TOKEN` - Jira API token
- `JIRA_BASE_URL` - https://tidb.atlassian.net
- `FEISHU_WIKI_SPACE_ID` - Feishu Wiki space ID
- `FEISHU_WIKI_PARENT_TOKEN` - Parent node token for docs
