Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The first endpoint is an asynchronous call to import tests. Whenever this endpoint is called, a job is queued to import the tests in the input and its id is returned. The second endpoint can be used to check the status of this job.

Apart from JIRA fields, in the test information in the input, the folowing fields can be used:

testtype (or xray_testtype): This field determines the test type of the corresponding test, this field can be filled with the option of any test field that is present in the project in which the test will be created. (this field is required)

steps (or xray_steps): It holds the steps information for a test with a test type of the Steps kind.

gherkin_def (or xray_gherkin_def): Gherkin definition for tests with a test type of the Gherkin kind.

unstructured_def (or xray_unstructured_def): Generic definition for tests with a test type of Unstructured kind.

If project information is ommited in a test, the project defined as a path parameter in the endpoint is used as the destination project, if no project is set as a path parameter, an error will occur importing the corresponding test.


Import Tests

When importing tests, you can use the following endpoint:

...

Expand
titleGET /api/v1/import/test/bulk/{jobId}/status
Panel
borderColor#ccc
borderStylesolid

Check an import test job status.

Request

PARAMETERS

parameter

type

description

jobIdString

- id of the import tests job.


Tip
titleExample Request

curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token"  --data @"data.json" https://xray.cloud.xpand-it.com/api/v1/import/test/bulk/34a4106b1d0948d1aae1170cc8df3bb4/status

Responses

200 OK : application/json : Successful. The job status is available.

Example 1: Job is still working

Code Block
titleExample Output
{
    "status": "working",
    "progress": [
        "[Tue, 03 Jul 2018 15:29:08 GMT] Preprocessing the information of the 3 tests to import.",
        "[Tue, 03 Jul 2018 15:29:08 GMT] Creating 3 issue(s) in JIRA."
    ]
}

Example 2: Job ended in partial success

Code Block
titleExample Output 2
{
    "status": "partially_successful",
    "result": {
        "errors": [
            {
                "elementNumber": 1,
                "errors": {
                    "description": "Operation value must be a string"
                }
            }
        ],
        "issues": [
            {
                "elementNumber": 0,
                "id": "12603",
                "key": "CALC-1",
                "self": "https://xpandsdcv.atlassian.net/rest/api/2/issue/12603"
            },
            {
                "elementNumber": 2,
                "id": "12604",
                "key": "CALC-2",
                "self": "https://xpandsdcv.atlassian.net/rest/api/2/issue/12604"
            }
        ]
    }
}


404 NOT_FOUND : application/json : Job was not found.

Code Block
languagejs
titleExample Output
{
    "error": "job not found."
}


401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.