Test Management for Jira Server

Annotations with Other CI Tools/Running Locally

If you are using Cucumber, setup could not be more simple. Add Test Management for Jira annotations to your Cucumber tests, and use our pre-made script to send the results to Jira. The integration is based on the JSON output files generated by Cucumber, so this output option needs to be configured properly, as follows.

annotations 01
  1. Configure the JSON output format for your automated tests on the TestRunner class. Here we’ve added JUnit and Cucumber output formats:

    features = "src/test/resources/calculatorFeatures"
    ,plugin = {"junit:target/cucumber/result.xml", "json:target/cucumber/calculator.json"}
  2. Annotate your automated tests with the @TestCaseKey tag.

    The @TestCase(key = "JQA-T1") annotation maps the test method to an existing test case in Test Management for Jira by matching its key. The @TestCase(name = "Sum Two Numbers") annotation adds a name to the test case. This maps this test method to an existing test case in Test Management for Jira by matching its name. If the test case doesn’t exist in Test Management for Jira, then a new one can be automatically created using this name when the results are uploaded.

    Scenarios can be mapped to test cases in Test Management for Jira by using the test-case key or name as a scenario tag.

    For example: @TestCaseKey=ABC-T123.

To Annotate a Cucumber Test

Feature: Calculator

  Scenario: Add a number
    Given a calculator I just turned on
    And I add 4 and 4
    Then the result is 8

To Annotate a JUnit Test

public class CalculatorSumTest {

    @TestCase(key = "JQA-T1")
    public void sumTwoNumbersAndPass() {
        Calculator calculator = new Calculator();
        assertEquals(5, calculator.sum(3, 2));

    @TestCase(key = "JQA-T2")
    public void sumTwoNumbersAndFail() {
        Calculator calculator = new Calculator();
        assertNotEquals(2, calculator.sum(1, 2));

    public void notMappedToTestCaseAndPass() {
        Calculator calculator = new Calculator();
        assertEquals(3, calculator.sum(1, 2));

    @TestCase(name = "Mapped to a Test Case Name and Pass")
    public void mappedToATestCaseNameAndPass() {
        Calculator calculator = new Calculator();
        assertEquals(4, calculator.sum(2, 2));


Now you can run the tests with Maven test, and the Test Management for Jira test execution results file will generate in the same execution folder.

Scripts for Local Testing/Other CI Tools

Add the following scripts to your project if you want to run automated tests locally.

For running automated tests with other CI tools, add this script as a task/script within the tool itself to run after the build.


When using JUnit with the custom output file provided by the Test Management for Jira JUnit Listener:

zip output_results.zip tm4j_result.json
curl --basic --user user:pass -F "file=@output_results.zip"

When using Cucumber:

zip output_results.zip target/cucumber/*
curl --basic --user user:pass -F "file=@output_results.zip"