Page History
...
Table of Contents | ||
---|---|---|
|
Importing Execution Results
Execution results can be imported to Jira through JSON/XML representation formats specified in Import Execution ResultsUsing Xray JSON format to import execution results.
For each import file format, Xray provides a specific REST endpoint:
Xray JSON format | /api/v1/import/execution |
Xray JSON format Multipart | /api/v1/import/execution/multipart |
Cucumber JSON output format | /api/v1/import/execution/cucumber |
Cucumber JSON output format Multipart | /api/v1/import/execution/cucumber/multipart |
JUnit XML output format | /api/v1/import/execution/junit |
JUnit XML output format Multipart | /api/v1/import/execution/junit/multipart |
NUnit XML output format | /api/v1/import/execution/nunit |
...
When importing execution results using Xray JSON result format in a Continuous Integration environment, you can specify which Test Execution issue to import the results on using the testExecutionKey property. Alternatively, you can create a new Test Execution for the execution results and specify the Test Execution issue fields in the info object.
NUnit XML output format Multipart | /api/v1/import/execution/nunit/multipart |
xUnit XML output format | /api/v1/import/execution/xunit |
xUnit XML output format Multipart | /api/v1/import/execution/xunit/multipart |
TestNG XML output format | /api/v1/import/execution/testng |
TestNG XML output format Multipart | /api/v1/import/execution/testng/multipart |
Robot Framework XML output format | /api/v1/import/execution/robot |
Robot Framework XML output format multipart | /api/v1/import/execution/robot/multipart |
Behave JSON output format | /api/v1/import/execution/behave |
Behave JSON output format Multipart | /api/v1/import/execution/behave/multipart |
Xray JSON results
When importing execution results using Xray JSON result format in a Continuous Integration environment, you can specify which Test Execution issue to import the results on using the testExecutionKey property. Alternatively, you can create a new Test Execution for the execution results and specify the Test Execution issue fields in the info object.
Expand | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
Expand | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
|
...
Xray JSON results
...
After executing Cucumber features, you must import the outputted JSON execution results to Jira using the following endpoint:
Multipart
Xray provides another endpoint if you want to create or update a Test Executions and have control over all Test Execution fields. It allows you to send two JSON files, the normal Xray JSON result and a JSON similar to the one Jira uses to create/update issues. For more information about that second format, check the Jira documentation here. Note that in this endpoint the info
property in the Xray Json result part will be ignored.
Expand | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||
|
Cucumber JSON results
After executing Cucumber features, you must import the outputted JSON execution results to Jira using the following endpoint:
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
|
JUnit XML results
After executing JUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:
...
title | POST /rest/raven/1.0/import/execution/junit |
---|
...
borderColor | #ccc |
---|---|
borderStyle | solid |
Import the execution results created with the JUnit XML output formatter. For more information, please check the documentation about JUnit integration.
Request
PATH PARAMETERS
...
|
Cucumber JSON results Multipart
Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution fields. It allows you to send two JSON files, the normal Cucumber result JSON and a JSON similar to the one Jira uses to create new issues. For more information about that second format, check the Jira documentation here.
Expand | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
JUnit XML results
After executing JUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:
Expand | |||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||
|
JUnit XML results Multipart
Xray provides another endpoint if you want to have control over the fields of newly created Test Executions and Tests. The endpoint accepts one XML file (the JUnit report) and two JSON files similar to the one Jira uses to create new issues, one with the fields of the Test Execution and the other with the fields of the Test. For more information about that JSON format, check the Jira documentation here. Xray will ignore the issue type and the summary fields on the Test JSON file since these are provided by the importation.
Expand | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
|
NUnit XML results
After executing NUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:
Expand | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
|
NUnit XML results Multipart
Xray provides another endpoint if you want to have control over the fields of newly created Test Executions and Tests. The endpoint accepts one XML file (the NUnit report) and two JSON files similar to the one Jira uses to create new issues, one with the fields of the Test Execution and the other with the fields of the Test. For more information about that JSON format, check the Jira documentation here. Xray will ignore the issue type and the summary fields on the Test JSON file since these are provided by the importation.
Expand | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
|
xUnit XML results
After executing xUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:
Expand | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
|
xUnit XML results Multipart
Xray provides another endpoint if you want to have control over the fields of newly created Test Executions and Tests. The endpoint accepts one XML file (the xUnit report) and two JSON files similar to the one Jira uses to create new issues, one with the fields of the Test Execution and the other with the fields of the Test. For more information about that JSON format, check the Jira documentation here. Xray will ignore the issue type and the summary fields on the Test JSON file since these are provided by the importation.
Expand | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
|
TestNG XML results
After executing TestNG tests, you must import the outputted XML execution results to Jira using the following endpoint:
Expand | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
|
TestNG XML results Multipart
Xray provides another endpoint if you want to have control over the fields of newly created Test Executions and Tests. The endpoint accepts one XML file (the TestNG report) and two JSON files similar to the one Jira uses to create new issues, one with the fields of the Test Execution and the other with the fields of the Test. For more information about that JSON format, check the Jira documentation here. Xray will ignore the issue type and the summary fields on the Test JSON file since these are provided by the importation.
Expand | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
|
Robot Framework XML results
After executing Robot Framework tests, you must import the outputted XML execution results to Jira using the following endpoint:
Expand | |||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||
|
Robot Framework XML results Multipart
Xray provides another endpoint if you want to have control over the fields of newly created Test Executions and Tests. The endpoint accepts one XML file (the Robot report) and two JSON files similar to the one Jira uses to create new issues, one with the fields of the Test Execution and the other with the fields of the Test. For more information about that JSON format, check the Jira documentation here. Xray will ignore the issue type and the summary fields on the Test JSON file since these are provided by the importation.
Expand | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
|
Behave JSON results
After executing Behave features, you must import the outputted JSON execution results to Jira using the following endpoint:
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
|
Behave JSON results Multipart
Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution fields. It allows you to send two JSON files, the normal Behave result JSON and a JSON similar to the one Jira uses to create new issues. For more information about that second format, check the Jira documentation here.
Expand | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
- key of the project where the test execution (if the testExecKey parameter wasn't provided) and the tests (if they aren't created yet) are going to be created.
...
- the Fix Version associated with the test execution (it supports only one value).
Example
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="15" failures="0" name="ut.com.xpandit.raven.service.impl.IssueDataSetTest" time="0.163" errors="0" skipped="0">
<properties>
...
</properties>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidLimitOverflowOption_returnsExpectedSubset" time="0.114"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withNullOptionsAndValidIssue_throwsIllegalArgumentException" time="0.002"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidEmptyOptions_returnsAllIssues" time="0.002"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidGlobalSearchOptions_returnsExpectedTests" time="0.016"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndInvalidColumnSearchOption_returnsAllTests" time="0.007"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidLimitUnderOption_returnsExpectedSubset" time="0.001"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidGlobalSearchOptionThatMachesIssueKey_returnsExpectedTestWithMatchedKey" time="0.006"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidSummaryColumnAscSortOption_returnsExpectedIssuesInAscOrder" time="0.006"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidSummaryColumnDescSortOption_returnsExpectedIssuesInDescOrder" time="0.002"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidGlobalSearchOptionThatMatchesAllElements_returnsAllTests" time="0.001"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidColumnSearchOptionThatMatchesOneElement_returnsOneTest" time="0.002"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidColumnSearchOptionThatMatchesNoIssue_returnsEmptyList" time="0.001"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidGlobalSearchOptionThatMachesNoIssue_returnsEmptyList" time="0.001"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidKeyColumnDescSortOption_returnsExpectedIssuesInDescOrder" time="0.001"/>
<testcase classname="ut.com.xpandit.raven.service.impl.IssueDataSetTest" name="testApplyOptions_withValidIssueAndValidKeyColumnAscSortOption_returnsExpectedIssuesInAscOrder" time="0.001"/>
</testsuite> |
Tip | ||
---|---|---|
| ||
curl -H "Content-Type: application/text/xml" -X POST -H "Authorization: Bearer $token" --data @"data.xml" https://xray.cloud.xpand-it.com/api/v1/import/execution/junit?projectKey=XTP curl -H "Content-Type: application/text/xml" -X POST -H "Authorization: Bearer $token" --data @"data.xml" https://xray.cloud.xpand-it.com/api/v1/import/execution/junit?testExecKey=XNP-23 curl -H "Content-Type: application/text/xml" -X POST -H "Authorization: Bearer $token" --data @"data.xml" https://xray.cloud.xpand-it.com/api/v1/import/execution/junit?projectKey=XTP&testExecKey=XNP-23 curl -H "Content-Type: application/text/xml" -X POST -H "Authorization: Bearer $token" --data @"data.xml" https://xray.cloud.xpand-it.com/api/v1/import/execution/junit?projectKey=XTP&testPlanKey=XTP-12&revision=v2.1.0 |
Responses
200 OK : application/json : Successful. The results where successfully imported to Jira.
Code Block | ||
---|---|---|
| ||
{
"testExecIssue": {
"id": "10200",
"key": "XNP-24",
"self": "http://www.example.com/jira/rest/api/2/issue/10200"
}
} |
400 BAD_REQUEST : application/json : Returns the error.
401 UNAUTHORIZED : application/json : The token is invalid.
500 INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.
NUnit XML results
After executing NUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Responses200 OK : application/json : Successful. The results where results were successfully imported to Jira.
400 BAD_REQUEST : application/json : Returns the errorNo execution results were provided. 401 UNAUTHORIZED : application/json : The token Xray license is invalidnot valid. 500 INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results. |