This guide covers how to obtain and configure all Jira authentication keys and credentials needed for ticket-mate.
ticket-mate requires authentication credentials to access your Jira instance. There are two main authentication modes:
ATATT3xFfGF0... (starts with ATATT3x)Your Jira base URL is your Atlassian site URL:
https://your-site.atlassian.nethttps://pamcms.atlassian.netAdd to .env.local:
envATLASSIAN_BASE_URL=https://your-site.atlassian.net ATLASSIAN_EMAIL=your-email@example.com ATLASSIAN_API_KEY=ATATT3xFfGF0...your-192-character-token
Run the check command:
bashtm env-check
You should see:
✅ ATLASSIAN_BASE_URL = https://your-site.atlassian.net
✅ ATLASSIAN_EMAIL = your-email@example.com
✅ ATLASSIAN_API_KEY = ATATT3x***K9wq (length: 192)
bashtm check-permissions
This will show:
For production deployments and company-managed applications, use OAuth 2.0.
ticket-mate (or your app name)In your app settings, go to "Authorization"
Set Callback URL:
http://localhost:4000/api/auth/jira/callback
(For production, use your actual domain)
Add Scopes (required permissions):
read:jira-work - Read Jira issues, projects, boardswrite:jira-work - Create and update issuesread:jira-user - Read user informationoffline_access - Refresh tokensj8yykR...)Add to .env.local:
envATLASSIAN_AUTH_MODE=OAUTH ATLASSIAN_CLIENT_ID=your-client-id ATLASSIAN_CLIENT_SECRET=your-client-secret ATLASSIAN_REDIRECT_URI=http://localhost:4000/api/auth/jira/callback
Users will connect their Jira accounts through the OAuth flow:
Note: In OAuth mode, cloudId is automatically stored per-user after the OAuth flow completes. You don't need to set ATLASSIAN_CLOUD_ID in environment variables.
Cloud ID is required when using scoped API tokens or Cloud API URLs.
ATATT3x...)ATLASSIAN_USE_CLOUD_API=truef82a209c-ad3a-4c8c-b311-fc3bf6e584b5bashcurl -u your-email@example.com:your-api-token \ https://your-site.atlassian.net/rest/api/3/serverInfo
Look for deploymentId in the response.
For PAT mode, add to .env.local:
envATLASSIAN_USE_CLOUD_API=true ATLASSIAN_CLOUD_ID=f82a209c-ad3a-4c8c-b311-fc3bf6e584b5
Note: In OAuth mode, Cloud ID is automatically stored per-user and doesn't need to be set in env.
The default project key is SPACE2. You can override it in several ways:
bashtm check-permissions -p SPACE2 tm create-ticket -p SPACE2 -t "My ticket"
envATLASSIAN_PROJECT_KEY=SPACE2
Create jira.json or ticket-mate.json:
json{ "projectKey": "SPACE2" }
Ensure you have the following permissions on your project:
Check permissions:
bashtm check-permissions -p SPACE2
For company-managed Atlassian apps:
For project-specific access (e.g., NOVA project):
Problem: Invalid API token or credentials
Solutions:
bashtm env-check
ATLASSIAN_EMAIL matches your Atlassian account emailATLASSIAN_BASE_URL is correctProblem: Token doesn't have project access or wrong API endpoint
Solutions:
envATLASSIAN_USE_CLOUD_API=true ATLASSIAN_CLOUD_ID=your-cloud-id
bashtm check-permissions -p SPACE2
Problem: Project key doesn't exist or no access
Solutions:
bashtm ls-projects
Problem: Wrong client ID/secret or app not approved
Solutions:
ATLASSIAN_CLIENT_ID and ATLASSIAN_CLIENT_SECRET in .env.localProblem: Token is only 75 characters instead of 192
Solution: You may have an old token format. Generate a new one:
.env.localATLASSIAN_BASE_URL - Your Jira site URLATLASSIAN_EMAIL - Your Atlassian emailATLASSIAN_API_KEY - ~192 character token from API TokensATLASSIAN_CLIENT_ID - From Developer ConsoleATLASSIAN_CLIENT_SECRET - From Developer ConsoleATLASSIAN_REDIRECT_URI - OAuth callback URLATLASSIAN_CLOUD_ID - For Cloud API (find at Admin Console)ATLASSIAN_PROJECT_KEY - Default project (defaults to SPACE2)ATLASSIAN_USE_CLOUD_API - Enable Cloud API modeIf you're stuck:
tm env-checktm check-permissionstm ls-projectstm env-debugFor company-managed apps, contact your Atlassian admin for: