Troubleshoot "Invalid Jira account" issue with Jira Integration
Resolving permission issues with the Jira API key involves a systematic approach to ensure that all aspects of authentication, user permissions, and API configuration are correctly set up. Follow these steps to troubleshoot and resolve the issue:
-
Confirm Jira Deployment Type
- Jira Cloud Deployment: Ensure your Jira instance is a Cloud deployment. The integration is only supported for Jira Cloud and is not compatible with On-Premise (Server/Data Center) instances.
-
Validate the Jira URL Format
- Correct URL Format: Make sure the Jira domain URL follows the correct structure:
-
Correct:
https://[your-domain].atlassian.net
Example:https://example.atlassian.net -
Incorrect: Avoid adding extra paths like /jira or other subdirectories.
Example of incorrect format:https://example.atlassian.net/jira
-
- Verify the Jira API Key
-
Use the Correct API Key: Confirm that the API key used for authentication is correct.
-
Create or Manage API Tokens:
- Navigate to Jira Profile > Manage Account > Security > Create and Manage API Tokens.
- Generate a new token or use an existing one.
-
Check Token Permissions: Ensure the API token has permissions for the API endpoints you are accessing.
-
Associate API Key with the Correct Email: The API key must be created using the email ID linked to your Jira account.
Reference:
Explore further instructions about How to manage API token for your Atlassian Account.
- Check User Permissions
-
Admin User Permissions: The admin user linked to the API key must have the required permissions in Jira.
-
Steps:
- Go to Jira Administration > User Management to verify the user’s permissions.
- Ensure the admin user is part of the Jira-administrators or Jira-system-administrators group.
- Verify the admin user has the necessary project roles (e.g., Administrator, Developer).
-
Add Missing Permissions: Add the required groups or roles if they are missing.
Reference:
Explore further instructions about Managing Users and Permissions in Jira.
- Validate Project Roles and Permissions
-
Project-Level Permissions:
-
Go to the project in Jira: Project Settings > Permissions.
-
Verify the user or group has permissions required for API actions.
-
Confirm the admin user has roles such as:
- Administrators: Full access.
- Browse Projects
- Edit Issues
- Create Issues
- Delete Issues
-
-
Add Missing Permissions: Update the project roles to grant the required permissions.
Reference:
Explore further instructions about Manage Permissions in Jira Cloud.
- Review Global Permissions
-
Global Permissions: Some API actions require global permissions.
-
Steps:
- Go to Jira Administration > Global Permissions.
- Verify the admin user has:
- Jira System Administrators
- Jira Administrators
- Browse Users
- Create Shared Objects
- Manage Group Filter Subscriptions (optional)
-
Assign Missing Permissions: Add permissions by updating the user or group settings.
Reference:
Explore further instructions about Manage Global Permissions.
- Test with a Different User
- Higher-Permission User: Test API access with a higher‑privileged user (e.g., an admin) to confirm if the issue is permission-related.
- Contact Jira Administrator
- Seek Assistance: If the issue persists, contact your Jira administrator to verify permission and API access settings.
- Example: Testing API Access
-
Step 1: Get Your Base64 Encoded String
- Combine your Jira email and API token in the format: email:API_TOKEN
- Encode using Base64:
echo -n "[email protected]:API_TOKEN" | base64
Replace [email protected] with your Jira email and API_TOKEN with your Jira API token.
Example:
echo -n "[email protected]:abc123" | base64
Output:
am9obi5kb2VAZXhhbXBsZS5jb206YWJjMTIz
- Step 2: Run the curl Command
curl -X GET \
-H "Authorization: Basic <BASE64_ENCODED_STRING>" \
"https://<your-domain>.atlassian.net/rest/api/3/issue/<issue-key>"
Replace:
- <BASE64_ENCODED_STRING> — Base64 string from Step 1
- (your-domain) — e.g.,
mycompany.atlassian.net - (issue-key) — e.g., PROJ-123
Example:
curl -X GET \
-H "Authorization: Basic am9obi5kb2VAZXhhbXBsZS5jb206YWJjMTIz" \
"https://mycompany.atlassian.net/rest/api/3/issue/PROJ-123"
-
Step 3: Interpret the Response
-
Success: Returns JSON with issue details.
-
Error Codes:
- 401 Unauthorized: Invalid credentials.
- 404 Not Found: Incorrect issue key or domain.
- 403 Forbidden: Missing permissions.
-
-
Step 4: Troubleshooting
-
401 Unauthorized
- Check email and API token.
- Verify Base64 string.
-
404 Not Found
- Validate the issue key.
- Verify the Jira domain.
-
403 Forbidden
- Confirm your account has the necessary permissions.
-
FAQs
-
Does Jira API access require a paid Jira license?
Yes. The user generating and using the API token must have an active, licensed account within the Jira Cloud instance. -
How long does a Jira API token remain valid?
API tokens do not expire automatically, but they can be manually revoked. If compromised, they should be deleted immediately. -
Can I use OAuth instead of a Jira API token?
Yes. Jira supports OAuth 2.0 for more complex integrations, but API tokens are simpler and more commonly used for basic automation.