Annotating tests within a development project with the corresponding test case key in Test Management for JIRA enables results to be posted to JIRA in the following ways:
Note: Currently annotations are available for JUnit and Cucumber tests
If you are using JUnit for your testing within a project, you will need to download the Test Management for JIRA automation library from our Bitbucket - https://bitbucket.org/account/user/Adaptavist/projects/TM4J.
Once you have done this, follow the instructions in the Overview section to add the automation library to your project - https://bitbucket.org/Adaptavist/tm4j-junit-integration
This will enable you to annotate your JUnit tests with a Test Management for JIRA key or name and will generate a custom report when you run the tests.
To send these results to JIRA, you'll need to include a pre-made script (see the section below) which will take care of this for you.
Alternatively, if you're using our Jenkins plugin, you can set up a task to do this for you.
Using other CI tools will require a task and script to be included also.
For an example of Test Management for JIRA integration with Cucumber, see here - https://bitbucket.org/Adaptavist/tm4j-cucumber-integration-example
Now you can run the tests with this command and the TM4J test execution result file will be generated in the same execution folder:
For an example of Test Management for JIRA integration with JUnit, see here - https://bitbucket.org/Adaptavist/tm4j-junit-integration-example
If you are running your tests locally or within a CI tool other than Jenkins, you'll need to include this script so that the results can be posted to Test Management for Jira.
For running automated tests locally, this will be within your project.
For running automated tests within another CI tool, this can be added as a task/script within the tool itself to run after the build.