Issue links
Test cases and launches can be linked to issues in third-party issue trackers like Jira, Redmine, etc.
In order to be able to add issue links, you first need to set up an integration with the required issue tracker. You can find instructions for supported issue trackers in the table of contents on the left (under Integrations → Issue trackers).
Issue links can be added manually using the web interface or automatically from the test results you upload to Allure TestOps. If you want to add issue links to automated test cases manually, you need to change your project's upload policy.
Adding links manually
To add an issue link to a test case:
- Go to Test cases.
- Select a test case.
- On the right side of the page, next to Issues links, click the pencil icon.
- Click the Add button.
- Under Issue tracker, select the issue tracker.
- Under Key, select the issue to which you want to link the test case.
- Click Submit.
To add an issue link to a launch:
- 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 the issue tracker.
- Under Key, select the issue to which you want to link the test case.
- Click Submit.
Setting links automatically from test results
Issue links can be added to test cases automatically when you upload test results to Allure TestOps. For this to work, you need to specify them in your integration code and create mappings for issue trackers in your project settings.
Specifying issue links in code
The exact implementation will depend on the testing framework you use, but as an example, here is what it might look like if you are using JUnit 5:
@Test
@JiraIssue("AE-2")
@DisplayName("Creating new issue by authorized user")
public void shouldCreateIssue() {
steps.openIssuesPage(OWNER, REPO);
steps.createIssueWithTitle(ISSUE_TITLE);
steps.shouldSeeIssueWithTitle(ISSUE_TITLE);
}
Notice the line starting with @JiraIssue. This line links the test case to the Jira issue AE-2.
The code above will generate a test result file with the field "labels". This field contains the properties that will be applied to the test case when the file is uploaded to Allure TestOps.
...
"labels": [
{
"name": "jira",
"value": "AE-2"
},
...
You can read more about using labels in the corresponding article.
Creating mappings
- Go to the project page.
- In the menu on the left, click Settings → Issues.
- Click the Create button.
- As the Key, specify the value you use in your code. For the example above, it is jira.
- As the Issue tracker, select the required issue tracker integration you previously added to your project. For the example above, it is a Jira integration.
- Click Submit.
Changing upload policy
If you want to link automated test cases to issues using the web interface instead of specifying issues in test results, you can change your upload policy to ignore issues from test results.
- Go to the project page.
- In the menu on the left, click Settings → Upload.
- Click the Create button.
- Under Field, select issue.
- Under Policy, select from_test_case.
- Click Submit.