Background
When you try to create a Jira issue from RealTheory, the issue is not created. The most common cause is an expired Jira API token.
Atlassian API tokens expire on a fixed schedule, one year by default. When yours expires, the connection stops until you generate a new one.
Solution
Prerequisite
You need Atlassian Organization Admin rights. Without them, the Service accounts page will not appear.
- Access: Atlassian Administration at admin.atlassian.com
- Limit: Each organization gets up to five service accounts free. More requires Atlassian Guard.
- Storage: A password manager or secrets vault ready to receive the token
- Cloud ID: Your Jira site's Cloud ID. You will need it to call the API. Find it in your admin URL, after
/s/. Do not use the Organization ID.
Step 1: Create the service account
A service account owns the token. No individual does. When someone leaves, the integration keeps running.
If you already have an active service account with access to your Jira projects, skip to Step 2: Generate the API token.
- Go to Atlassian Administration. Select your organization if you have more than one.
- Select Directory, then Service accounts.
- Create a new service account.
- Assign Jira product access and the project permissions the integration needs.
Examples: Jira Administrators, Project Administrators, or specific project roles.
Grant the minimum access the integration requires. Service accounts follow the same permission rules as user accounts. Missing permissions surface later as 401 or 404 errors.
Step 2: Generate the API token
Important: Atlassian shows the token once. Copy it before you leave the screen.
- In Atlassian Administration, go to Directory > Service accounts and select the service account.
- Select Create credentials, then API token, then Next.
- Name the token for what it does (for example,
realtheory-jira-integration). - Set the expiration. The range is 1 to 365 days. Record the date.
- Select scopes. For typical Jira work, use
read:jira-workandwrite:jira-work. Select only what the integration needs. - Review, then select Create.
- Select Copy to clipboard. Store the token in your password manager or secrets vault immediately.
Scopes are fixed at creation. To change them, create a new token.
Step 3: Test the token
The username is the service account email address. The password is the API token.
- Username: service account email
- Password: API token from Step 2: Generate the API token
Service account tokens must call the Atlassian API gateway, not your site URL. Requests to yourcompany.atlassian.net will fail.
https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/project
Test the token before you update the integration:
curl -u "<service-account-email>:<api-token>" \
-H "Accept: application/json" \
https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/project
A list of projects means the token works.
Step 4: Update the integration in RealTheory
Each row on the Ticketing Systems page is one integration. Update the one that stopped working.
- In the RealTheory Console, go to Settings > Ticketing Systems.
- Under Configured Integrations, find the integration to update.
- Select that integration to open it.
- Replace the username with the service account email.
- Replace the password with the new API token.
- Click Validate Configuration.
- Click Update Integration to save your changes.
Create a Jira issue from a recommendation to confirm the fix. It lands in the integration's Jira project.
If the test fails
| Symptom | Likely cause | Fix |
|---|---|---|
401 Unauthorized |
Wrong email, wrong token, or missing scope | Recheck credentials. Create a new token with the right scopes. |
404 Not Found |
Organization ID used instead of Cloud ID, or site URL used instead of the gateway | Use the Cloud ID with api.atlassian.com/ex/jira/ |
| Issue "does not exist" | Service account lacks project permission | Add it to the correct project role. Check with Jira's Permission Helper. |
To prevent this issue in the future
Token expiry is predictable. Plan for the next one now.
- Put the token expiration date on your team calendar, with a reminder 14 days out
- Record the service account name, token name, and scopes wherever your team tracks credentials
See Also
- Configuring Jira for Ticketing Integration
- Manage API tokens for service accounts (Atlassian Support)
- Manage API tokens for your Atlassian account (Atlassian Support)