Integration with GitHub Issues
This article describes how you can set up an integration with the GitHub issues system to be able to add issue links to your Allure TestOps test cases and launches. If you need to set up a GitHub CI integration to trigger test runs and receive test results, see this article instead.
If you have already set up a GitHub CI integration for your GitHub server, do the following:
Check the type of access token you have used for the integration.
If you are using a fine-grained token, create a new token with the following permissions and specify it in your existing integration in Allure TestOps:
- Repository permissions — select Read and write for both Actions and Issues.
- Repository access → Only select repositories — select the repositories that contain the workflows and issues you want to use.
If you are using a classic token, create a new token with the repo and workflow permissions and specify it in Allure TestOps.
In your current GitHub integration, specify the repositories that contain the issues you want to use (see Enabling integration for Allure TestOps project).
To set up GitHub Issues integration, you need to:
- Create an access token in your GitHub settings.
- Add GitHub integration in the Allure TestOps Administration section.
- Enable the integration in Allure TestOps project settings using the created access token.
Creating GitHub access token
GitHub supports two types of access tokens: fine-grained and classic (see Managing your personal access tokens in GitHub for more information). You can create either of them for the purposes of this integration.
In GitHub, click your avatar and go to Settings.
In the menu on the left, click Developer settings.
Go to Personal access tokens → Fine-grained tokens.
Click Generate new token.
Fill in the fields:
- Token name — a name to help you recognize the token (e.g., "Token for Allure TestOps").
- Expiration — specify how long the token should be valid. After this date, the integration will stop working, and you will need to create a new token to continue using the integration.
Under the Repository access section, click Only select repositories. In the drop-down list that appears, select the repositories that contain the issues you want to use.
Under the Permissions section, click Repository permissions. In the permission list that appears, find Issues and select Read and write next to it.
Click Generate token.
After the page reloads, you should see the newly created token. Click the copy icon next to it and save the token in a safe place, it will be needed later.
In GitHub, click your avatar and go to Settings.
In the menu on the left, click Developer settings.
Go to Personal access tokens → Tokens (classic).
Click Generate new token → Generate new token (classic).
Fill in the fields:
- Note — a name to help you recognize the token (e.g., "Token for Allure TestOps").
- Expiration — specify how long the token should be valid. After this date, the integration will stop working, and you will need to create a new token to continue using the integration.
Under the Select scopes section, check repo.
Click Generate token.
After the page reloads, you should see the newly created token. Click the copy icon next to it and save the token in a safe place, it will be needed later.
Adding GitHub integration in Allure TestOps
Log in to Allure TestOps using an administrator account.
Go to Administration → Integrations.
Click + Add integration in the top right corner of the page.
In the dialog that appears, select GitHub.
Fill in the fields:
- Name — a name to help you recognize the GitHub server (e.g., “GitHub production”).
- Endpoint — the base URL of GitHub. For github.com, use “https://github.com”. For GitHub Enterprise Server, use the URL of your GitHub instance.
- Endpoint for API calls — the URL of GitHub API. For github.com, use “https://api.github.com”. For GitHub Enterprise Server, use “⟨URL⟩/api/v3”, where ⟨URL⟩ is the URL of your GitHub instance.
If you are using GitHub Enterprise Server with a self-signed SSL certificate, check the Disable certificate validation box.
Click Add integration.
Enabling integration for Allure TestOps project
In Allure TestOps, open your project.
Go to Settings → Integrations.
Under Available integrations, find the GitHub integration and click Add integration next to it.
Under Settings, specify the repositories that contain the issues you want to use.
- Click + Add.
- In the Owner field, specify the owner of the repository.
- In the Repository name field, specify the name of the repository.
For example, for the repository github.com/torvalds/linux, the value for Owner will be
torvalds
, and the value for Repository name will belinux
.Under Secret, enter the GitHub access token you previously created.
Click Test connection. If the token is correct, a "Connection established" message will appear within a few seconds.
Click Add integration to save the settings.
Adding issue links
Once you have set up a GitHub Issues integration, you can add issue links to your test cases and launches.
To link a test case to a GitHub issue:
- Go to Test cases.
- Open the test case you want to link to the issue and click the pencil icon on the right side of the page, next to Issues links.
- In the resulting window, click + Add.
- Under Issue tracker, select your GitHub integration.
- Under Key, enter part of the name of the issue and select it from the drop-down list.
- Click Submit.
To link a launch to a GitHub issue:
- Go to Launches.
- Click
⋯
next to the launch you want to link to the issue and select Edit. - In the window that opens, click + Add in the Issues section.
- Under Issue tracker, select your GitHub integration.
- Under Key, enter part of the name of the issue and select it from the drop-down list.
- Click Submit.