Behave JSON result
There are 2 approaches to importing Behave JSON Result files using the API:
This Behave framework supports only Gherkin test cases. Test step details for other types will be excluded from the parsed results.
1. Import Test Result only
This approach allows you to quickly upload test results to AgileTest without needing to include extra metadata like test execution timestamps, environment details, or other specific execution parameters.
You can locate the endpoint at the POST /ds/test-executions/behave in the API document.

When you click on the 🔽 button, a dialog will appear. Here you can input your information for the test result file upload.

There are 2 main sections:
Parameters: fields that you define as key parameters required to make a successful API request. These parameters include:
Parameters | Type | Required | Description |
projectKey | string | ✅ | Key of the project where the test results will be imported. |
milestoneId | integer |
| Milestone id to link to Test execution. |
testExecutionKey | string |
| Test execution key to import test report. |
testPlanKeys | array[string] |
| Test plan key to import test report. If you specify a Test Plan, the tests will automatically be added to it if they are not already included. |
testEnvironments | array[string] |
| A string containing a list of test environments separated by ",". |
fixVersions | array[string] |
| A string containing a list of fixVersions separated by “,”. |
revision | string |
| Revision to link to Test execution. |
Request body: where you can input a JSON file, which is a Behave report that is going to be imported.
Learn more about the Behave testing framework.
Then, you will receive an output example
In case you want to use the command line, file pipeline, and other tools instead of API docs, you can copy the curl and input the token to import test results.
curl -X 'POST' \
'https://api.agiletest.app/ds/test-executions/behave?projectKey=ATP' \
-H 'accept: application/json' \
-H 'Authorization: JWT <token>' \
-H 'Content-Type: application/json' \
--data-binary '@my-report.json'
In that, <token> is the result from the Get Authenticated step.
2. Import Test Result with New Execution Details
This approach allows you to import Behave JSON test results while including additional execution details, such as timestamps, environment details, test execution keys, and other specific parameters related to the test executions.
You can locate the endpoint at the POST /ds/test-executions/behave/multipart in the API document.

For this request, it does not require any parameters. Instead, you need to submit two separate files:

A file containing the test results to import. This file resembles the test result files used in the Import Test Result only approach.
A file containing the test execution details. This file has some fields, and each of these fields serves a specific purpose in creating and organizing the test execution:
The
fieldsobject contains standard issue creation information, like what project it belongs to and what type of issue it is. It has 3 compulsory fieldssummary,project.id, andissuetype.id. Additionally, you can include other optional Jira fields, such as labels, priority, or any custom fields that your Jira instance uses.The
agileTestFieldsobject contains Agile Test-specific information for linking the execution to milestones and test plans, both of which are optional.
Field | Group | Type | Required | Description |
summary | fields | string | ✅ | Summary of Test execution issue that will be created. |
project.id | string | ✅ | Project ID in which the Test execution will be created. | |
issuetype.id | string | ✅ | The identifier specifying the type of issue to be created. | |
… | … |
| … | |
milestoneId | agileTestFields | integer |
| The identifier of the milestone that this test execution should be associated with. |
testPlanKeys | array of string |
| An array of issue keys of Test plan that this test execution is related to. | |
testEnvironments | array of string |
| A string containing a list of test environments separated by ",". | |
fixVersions | array of string |
| A string containing a list of fixVersions separated by “,”. | |
revision | string |
| Revision to link to Test execution. |
Make sure all details provided are accurate and relevant; otherwise, the request will fail. For example, if the issuetype.id you specify a value that does not exist in the project with ID 17110, the system will return an error with the corresponding error code 400.
Then, you will receive an output example
In case you want to use the command line, file pipeline, and other tools instead of API docs, you can copy the curl and input the token to import test results.
curl -X 'POST' \
'https://api.agiletest.app/ds/test-executions/behave/multipart' \
-H 'accept: application/json' \
-H 'Authorization: JWT <token>' \
-H 'Content-Type: multipart/form-data' \
-F 'results=@my-report.json;type=application/json' \
-F 'testExecution=@test-execution.json;type=application/json'
In that, <token> is the result from the Get Authenticated step.
Should you need any assistance or further AgileTest inquiries, contact our 24/7 Support Desk!