Integration with Xray
Xray is a test management plugin for Jira. Allure TestOps provides a one-way (export only) integration that sends information about the test cases to Xray, so that it can create and update a Jira issue for each test case. The integration supports Allure Query Language for limiting the scope of data to be exported, i.e., you can only mirror test cases with a specific tag.
To enable this integration, you need to:
- Generate two API tokens in your Jira settings.
- Enable Xray integration in Allure TestOps using the generated API tokens.
- Create one or more export rules in the integration settings.
This documentation refers to the Xray Test Management plugin for Jira Software Cloud. The plugin for self-hosted Jira Data Center installations is not currently supported.
1. Prepare necessary API tokens
1.1. Create an API token in Jira
Skip this if you prefer to use your username and password as the credentials for Jira Data Center.
In Jira, click on your avatar and go to Profile.
In the menu on the left, click Personal Access Tokens.
Click Create token.
Fill in the fields:
- Token Name — a name to help you recognize the token, e.g., “Token for Allure TestOps”.
- Expiry date — how long the token must stay valid. After this date, the integration will stop working, and you will need to create a new token to continue using the integration. To create a token that never expires, uncheck Automatic expiry.
Click Create.
The new token will become temporarily visible.
Save it to a file or otherwise make sure that you will be able to provide it later on step 2.2.
In Jira, click on your avatar and go to Manage account.
In the top navigation menu, go to Security.
Under the API tokens section, click Create and manage API tokens.
Click Create API token.
Enter a name to help you recognize the token, e.g., “Token for Allure TestOps”.
Click Create, then click Copy.
The new token will be copied into your clipboard.
Save it to a file or otherwise make sure that you will be able to provide it later on step 2.2.
1.2. Create an API token in Xray
If you are using Xray for Jira Data Center, you do not have to create additional API token on this step.
Make sure the Xray Test Management plugin is installed and configured for your Jira project.
In Jira, select Apps → Manage your apps in the top navigation menu.
In the menu on the left, click Xray → API Keys.
Click Create API Key.
In the dialog that appears, type your name or email in the User field and select your account from the autocomplete popup.
Click Generate.
Copy both Client ID and Client Secret.
Save these credentials to a file or otherwise make sure that you will be able to provide them later on step 2.2.
2. Configure the integration
2.1. Specify Jira URL in Allure TestOps
Log into Allure TestOps using an administrator account.
Click on your avatar and go to Administration → Integrations.
Click Add integration in the top right corner of the page.
In the dialog that appears, select:
- Xray Test Management for Jira if you use Jira Data Center,
- Xray Test Management for Jira Cloud if you use Jira Software Cloud.
Fill in the fields:
- Name — a name to help you recognize the integration, e.g., “Xray production”.
- Endpoint — the URL of the Jira instance, e.g., “https://example.atlassian.net/”.
Click Add integration.
2.2. Add Xray integration to an Allure TestOps project
In Allure TestOps, go to the project page.
In the menu on the left, click Settings → Integrations.
Under the Available integrations, find the Xray integration and click Add integration next to it.
In the dialog that appears, enter the credentials for connecting to Jira.
On the Basic tab in the dialog, enter the Username and Password of the Jira user.
On the Token tab in the dialog, enter the Token that you got on step 1.1.
Check that the credentials are correct
Click Test connection. After a few moments, a message should appear saying “Connection established”.
Click Add integration to close the dialog and save the settings.
3. Enable sync
In Allure TestOps, go to the project page.
In the menu on the left, click Settings → Integrations.
Click on the integration that you added in step 2.2.
On the TMS Sync tab, click Create.
In the Project dropdown list, select the Jira project to which Allure TestOps should sent test run data.
Specify which data Allure TestOps should export to Xray:
- Test Case AQL — an AQL expression for selecting the test cases that will be synced, e.g.,
automation = false
. Leave empty to sync all test cases. - Launches AQL — an AQL expression for selecting the launches that will be synced, e.g.,
name ~= "Release"
. Leave empty to sync all launches. - Disable export — check to completely disable the Xray integration.
- Disable Test Case create — check to disable exporting information about new test cases.
- Disable Launches sync — check to disable exporting information about test launches.
- Test Case AQL — an AQL expression for selecting the test cases that will be synced, e.g.,
Click Submit to apply the changes.