Add an issue link
You can add an issue link from the issue tracker to the test case or test result manually or you can set up automatic adding issue links to the test cases.
Add an Issue Link
-
In the Test cases section, select a test case.
-
On the Overview tab, go to the test case Issues section and click Edit.
-
Select Tracker and Key from the drop-down lists, and then click Submit.
You can add issue links to a test results in the same way.
To sync issue data automatically, you need to set the Sync check-box when configuring Issue Tracker.
You can also add a link to the issue for the Mute.
Add issue link for the TestResult
Set up the automatic adding issue links
You can configure automatic adding issue links to the test cases using annotations.
- In the test case code, create an annotation.
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import io.qameta.allure.LabelAnnotation;
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
@LabelAnnotation(name = "jira")
public @interface JiraIssue {
String value();
}
-
JiraIssue is the name of annotation in the example.
-
@LabelAnnotation declares label parameter with the name “jira” and the value () that Allure will use in test cases.
- Mark all required test cases with the created annotation JiraIssue.
@JiraIssue("AS-4")
@Test
void testEveryting() {
...
}
-
Configure issue mapping for the Allure project.
To do that, go to the Settings tab of required project, then to the Issues section. Create a key with the value from @LabelAnnotation (name = “jira”).
-
Now the test cases in Allure TestOPs will contain links to issues.