Integration with GitLab Issues
This article describes how you can set up an integration with the GitLab issues system to be able to add issue links to your Allure TestOps test cases and launches. If you need to set up a GitLab CI integration to trigger test runs and receive test results, see this article instead.
If you have already set up a GitLab CI integration for your GitLab server, the only thing you need to do to be able to link GitLab issues is to add GitLab project IDs to your current integration (see Enabling integration for Allure TestOps project).
To set up GitLab Issues integration, you need to:
- Generate an access token in your GitLab settings.
- Add GitLab integration in the Allure TestOps administration panel.
- Enable the integration in Allure TestOps project settings using the generated access token.
Generating GitLab access token
In GitLab, click on your avatar and select Preferences.
In the menu on the left, click Access Tokens.
Click Add new token on the right side of the page.
Fill in the fields:
- Token name — a name to help you recognize the token (e.g., "Token for Allure TestOps").
- Expiration date — any date within a year from the current date. After this date, the integration will stop working, and you will need to create a new token to continue using the integration.
Check the
api
andread_api
boxes under Select scopes.Click Create personal access token.
After the page reloads, click the copy icon under Your new personal access token. Save the token in a safe place, it will be needed later.
You can also use project access token instead of a personal access token, but in that case the integration will be limited to a single project.
Adding GitLab integration in Allure TestOps
Log in to 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 resulting window, select GitLab.
Fill in the fields:
- Name — a name to help you recognize this integration later.
- Endpoint — the URL of your GitLab server (e.g., https://gitlab.example.com/).
If your GitLab server uses a self-signed SSL certificate, check the Disable certificate validation checkbox.
Click Add integration.
Enabling integration for Allure TestOps project
Go to the project settings.
Select Integrations.
Find the GitLab integration and click Add integration.
Under Settings, add the project IDs of the GitLab projects you want to use.
To find the project ID, open the project in GitLab and go to Settings → General
Under Secret, enter the GitLab access token you previously generated.
Click Add integration.
Adding issue links
Once you have set up a GitLab Issues integration, you can add issue links to your test cases and launches.
To link a test case to a GitLab issue:
- Go to Test cases.
- Select the test case you want to link and click the pencil icon on the right side of the page, next to Issues links.
- In the resulting window, click the Add button.
- Under Issue tracker, select your GitLab Issues integration.
- Under Key, select the issue to which you want to link the test case.
- Click Submit.
To link a launch to a GitLab issue:
- Go to Launches.
- Click the
⋮
icon on the right side of the launch you want to link, and select Link to an issue. - Under Issue tracker, select your GitLab Issues integration.
- Under Key, select the issue to which you want to link the test case.
- Click Submit.