Check if the commit message follows the Jira ticket format (e.g., COM-1234).
If there is a Jira ticket in the commit message, do nothing.
If there is no ticket specified in the commit message, create a Jira ticket for the task.

## Authentication
Source ~/.zshrc to load environment variables before making API calls.
Use the JIRA_DC_TOKEN environment variable with Bearer authentication:
```bash
source ~/.zshrc
curl -H "Authorization: Bearer $JIRA_DC_TOKEN"
```

Note: Basic authentication is disabled on this Jira instance.

## Create Ticket
Use https://developer.atlassian.com/server/jira/platform/rest/v10002/api-group-issue/#api-api-2-issue-post to create the ticket.

Example curl command:
```bash
source ~/.zshrc && curl -s -X POST "https://bulldog.internal.atlassian.com/rest/api/2/issue" \
  -H "Authorization: Bearer $JIRA_DC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "project": {"key": "COM"},
      "customfield_10000": "COM-1771",
      "summary": "<commit message>",
      "description": "<commit message>",
      "issuetype": {"name": "Task"},
      "priority": {"name": "Medium"},
      "labels": ["eslint", "automation"]
    }
  }'
```

Note: `customfield_10000` is the Epic Link field.

## After Creating Ticket
Amend the commit to include the ticket reference:
```bash
git commit --amend -m "<TICKET-KEY>: <original commit message>"
```

## Ticket Fields
- Summary: The commit message
- Description: The commit message
- Epic Link: COM-1771 (customfield_10000)
- Type: Task
- Priority: Medium
- Labels: eslint, automation
