Skip to content

Commit 7055927

Browse files
git-hyagiclaude
andauthored
fix: parse JIRA_API_TOKEN as email:token composite credential (#1164)
Alcove now stores Jira credentials in email:api_token format. Parse JIRA_API_TOKEN by splitting on the first colon to extract the email (used as username) and token, removing the need for a separate JIRA_USERNAME env var. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1eb7362 commit 7055927

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

.alcove/agents/splunk-analyzer.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ executable:
1010
SPLUNK_INSECURE_SKIP_VERIFY: "true"
1111
SPLUNK_URL: "https://splunk-api.corp.redhat.com:8089/"
1212
JIRA_URL: "https://redhat.atlassian.net/"
13-
JIRA_USERNAME: "dkliban+pulp-sre-agent@redhat.com"
1413

1514
timeout: 1800
1615
enforcement_mode: monitor

tools/agents/agent-splunk/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ An AI agent that queries Splunk for 5xx errors, analyzes them using an LLM (Clau
1818
| `SPLUNK_URL` | Splunk instance URL |
1919
| `SPLUNK_TOKEN` | Splunk auth token |
2020
| `JIRA_URL` | Jira instance URL (e.g. `https://redhat.atlassian.net`) |
21-
| `JIRA_USERNAME` | Jira username (email) for API authentication |
22-
| `JIRA_API_TOKEN` | Jira API token for authentication |
21+
| `JIRA_API_TOKEN` | Jira credentials in `email:api_token` format (e.g. `user@company.com:ATATT3x...`) |
2322

2423
## Usage
2524

tools/agents/agent-splunk/main.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,13 @@ func run() error {
115115

116116
// --- Jira (native tool) ---
117117
if jiraURL := os.Getenv("JIRA_URL"); jiraURL != "" {
118-
jiraUsername := os.Getenv("JIRA_USERNAME")
119-
jiraToken := os.Getenv("JIRA_API_TOKEN")
120-
if jiraUsername == "" || jiraToken == "" {
121-
return fmt.Errorf("JIRA_USERNAME and JIRA_API_TOKEN are required when JIRA_URL is set")
118+
jiraCredential := os.Getenv("JIRA_API_TOKEN")
119+
if jiraCredential == "" {
120+
return fmt.Errorf("JIRA_API_TOKEN is required when JIRA_URL is set (format: email:api_token)")
121+
}
122+
jiraUsername, jiraToken, found := strings.Cut(jiraCredential, ":")
123+
if !found || jiraUsername == "" || jiraToken == "" {
124+
return fmt.Errorf("JIRA_API_TOKEN must be in email:api_token format")
122125
}
123126
jiraClient := jira.NewClient(jiraURL, jiraUsername, jiraToken)
124127
jiraTools := jiraClient.RegisterTools(mcpMgr)

0 commit comments

Comments
 (0)