When a new JIRA ticket is created (in a specific project and issue type), this pipeline triggers a GitHub Actions workflow that runs Cursor CLI with the sunspectra-ecommerce-analyst skill to perform data-driven analysis, then posts the results back to the JIRA ticket as a comment.
- Trigger: A new JIRA ticket is created (or a user replies to the bot's comment) in the configured project.
- Analysis: JIRA Automation sends a webhook to GitHub, which runs a workflow. The workflow invokes Cursor CLI with the sunspectra-ecommerce-analyst skill to analyze the ticket using Snowflake data (via Solid MCP text2SQL and
scripts/query_snowflake.py). - Post-back: The analysis output is posted as a comment on the original JIRA ticket. Each comment includes a session ID so users can reply to continue the conversation.
flowchart LR
subgraph JIRA [JIRA Cloud]
Ticket[New Ticket Created]
Filter[Project + Type Filter]
Webhook[Send Web Request]
end
subgraph GitHub [GitHub]
Dispatch[repository_dispatch]
Workflow[GitHub Actions Workflow]
Cursor[Cursor CLI Agent]
Post[Post to JIRA API]
end
Ticket --> Filter
Filter --> Webhook
Webhook -->|POST + client_payload| Dispatch
Dispatch --> Workflow
Workflow --> Cursor
Cursor -->|Analysis output| Post
Post -->|Comment| Ticket
Step-by-step flow:
- JIRA Automation fires when an issue is created (filtered by project and issue type).
- JIRA sends a POST request to GitHub's
repository_dispatchAPI with the ticket key. - GitHub Actions runs the workflow: fetch issue from JIRA, checkout, Python setup, Cursor CLI install, agent run.
- Cursor CLI executes the sunspectra-ecommerce-analyst skill (text2SQL → Snowflake → analysis).
scripts/post_to_jira.pyposts the analysis output as a comment on the JIRA ticket.
- JIRA Cloud project with Automation enabled
- GitHub repository with Actions enabled
- Cursor account (for
CURSOR_API_KEY) - Snowflake access (for the analysis queries)
- Solid MCP (for text2SQL in the skill; requires
SOLIDDATA_MANAGEMENT_KEYfor auth; see MCP and Skill in CI)
Add these secrets in Settings → Secrets and variables → Actions:
| Secret | Description |
|---|---|
SOLIDDATA_MANAGEMENT_KEY |
Solid management key; exchanged for an access token at workflow start (see Solid auth) |
SNOWFLAKE_ACCOUNT |
Snowflake account identifier (e.g. xy12345.us-east-1) |
SNOWFLAKE_USER |
Snowflake username |
SNOWFLAKE_PASSWORD |
Snowflake password |
SNOWFLAKE_WAREHOUSE |
Snowflake warehouse name |
SNOWFLAKE_DATABASE |
Snowflake database (e.g. SUN_SPECTRA) |
SNOWFLAKE_SCHEMA |
(Optional) Snowflake schema |
CURSOR_API_KEY |
Cursor API key from your Cursor account |
JIRA_BASE_URL |
JIRA Cloud base URL (e.g. https://your-domain.atlassian.net) |
JIRA_EMAIL |
Atlassian account email |
JIRA_API_TOKEN |
JIRA API token from id.atlassian.com |
- Go to Project settings → Automation.
- Create a new rule.
- Trigger: Issue created
- Conditions:
- Project equals
[YOUR_PROJECT_KEY] - Issue type equals
[YOUR_ISSUE_TYPE](e.g. "Analysis Request" or "Story")
- Project equals
- Action: Send web request
- URL:
https://api.github.com/repos/OWNER/REPO/dispatches(replaceOWNERandREPOwith your GitHub org/repo) - Method: POST
- Headers:
Accept:application/vnd.github.v3+jsonAuthorization:Bearer {{your_github_pat}}(store the PAT as a JIRA secret/variable)
- Body (JSON):
- URL:
{
"event_type": "jira_analysis_request",
"client_payload": {
"issue_key": "{{issue.key}}"
}
}The workflow fetches the summary and description from JIRA itself, so they do not need to be sent.
Create a GitHub Personal Access Token with repo scope and store it securely in JIRA Automation (e.g. as a secret or variable).
To let users reply to the bot's analysis and continue the conversation:
- Create a second automation rule.
- Trigger: Comment created
- Conditions:
- Project equals
[YOUR_PROJECT_KEY] - Issue type equals
[YOUR_ISSUE_TYPE] - Comment author is not
[JIRA_EMAIL](exclude the bot so it doesn't reply to itself)
- Project equals
- Action: Send web request
- URL:
https://api.github.com/repos/OWNER/REPO/dispatches - Method: POST
- Headers: Same as above
- Body (JSON):
- URL:
{
"event_type": "jira_comment_reply",
"client_payload": {
"issue_key": "{{issue.key}}",
"comment_body": "{{comment.body}}"
}
}The workflow fetches the session ID from the bot's previous comment and uses Cursor's --resume to continue the conversation. If the session has expired, it falls back to a fresh run with context injection.
The workflow exchanges SOLIDDATA_MANAGEMENT_KEY for an access token at startup:
- The "Exchange Solid management key for token" step calls
https://backend.production.soliddata.io/api/v1/auth/exchange_user_access_keywith the management key. - The returned token is stored as
SOLIDDATA_TOKENand passed to the Cursor step for Solid MCP (text2SQL) authentication. - Add
SOLIDDATA_MANAGEMENT_KEYto GitHub Secrets. Locally, usescripts/exchange_solid_token.pyto verify the key works.
- Create a test ticket in the configured JIRA project with the configured issue type.
- In GitHub, go to Actions and confirm the workflow run started.
- When the run completes, check the JIRA ticket for a new comment with the analysis.
Manual test from GitHub UI: Go to Actions → JIRA Analysis Pipeline → Run workflow. Enter an issue key (e.g. SA-1). The workflow fetches the ticket from JIRA and posts the analysis as a comment.
- Project and issue type: Edit the JIRA Automation rule conditions to change which tickets trigger the pipeline.
- GitHub repo URL: Update the webhook URL in the JIRA "Send web request" action if you move or rename the repo.
- Timeout: The workflow uses a timeout on the Cursor step to avoid indefinite hangs; adjust in
.github/workflows/jira-analysis.ymlif needed.
- Confirm the JIRA Automation rule is enabled and the conditions match your test ticket.
- Verify the webhook URL is correct (
https://api.github.com/repos/OWNER/REPO/dispatches). - Ensure the GitHub PAT has
reposcope and is valid. - Check JIRA Automation execution history for errors.
- Some users report
agent -phanging in CI. The workflow includes a timeout; increase it if analyses are long. - Verify MCP (Solid text2SQL) is available in headless mode; see MCP and Skill in CI.
- Confirm
JIRA_BASE_URL,JIRA_EMAIL, andJIRA_API_TOKENare set correctly in GitHub Secrets. - Ensure the JIRA user has permission to add comments to the issue.
- Check the workflow logs for the full error (secrets are masked).
- Confirm
SOLIDDATA_MANAGEMENT_KEYis set correctly in GitHub Secrets. - Verify the key is not expired and is valid for the production endpoint (
https://backend.production.soliddata.io). - Run
python scripts/exchange_solid_token.pylocally with the same key to test.
The skill uses mcp_solid_text2sql. If MCP does not work in Cursor CLI headless mode:
- Add
.cursor/mcp.jsonto the repo if Solid provides a project-level config for CI. - Verify locally: run
agent -p "Use mcp_solid_text2sql to generate SQL for: What is the open rate by campaign segment for the last 3 months?"in the project directory. - If MCP cannot run in CI, consider a Python-only path using Solid's HTTP API (if available) plus
scripts/query_snowflake.py.
From the project root:
agent -p "Use the sunspectra-ecommerce-analyst skill to analyze: What is the open rate by campaign segment for the last 3 months?"Ensure .env is configured with Snowflake credentials and Cursor CLI is installed.
To verify SOLIDDATA_MANAGEMENT_KEY works:
python scripts/exchange_solid_token.pySet SOLIDDATA_MANAGEMENT_KEY in .env or the environment. The script prints the access token to stdout.
# From stdin
echo "Test analysis output" | python scripts/post_to_jira.py --issue-key PROJECT-123
# Or with --body
python scripts/post_to_jira.py --issue-key PROJECT-123 --body "Test analysis output"Set JIRA_BASE_URL, JIRA_EMAIL, and JIRA_API_TOKEN in .env or the environment.
python scripts/fetch_jira_comments.py --issue-key SA-1Fetches comments and extracts the session ID from the bot's comment (for reply continuation).