Check an import test job status. Request PARAMETERSparameter | type | description |
---|
jobId | String | - id of the import tests job. |
When a job is created its status becomes available using this endpoint, it will remain so for approximately one day, after that the job status is removed. The status field has one of the following values: - pending: the job was created but is not running yet.
- working: the job is currently running.
- failed: the job ended in failure.
- successful: all tests were successfully imported and the job ended.
- partially_successful: some tests were imported sucessfully and some weren't and the job has finished.
- unsuccessful: no tests were imported and job has finished.
When the job ends, in the status the result will be returned. This result has 2 sections, the errors section and the issues section, the first one has all the tests that weren't imported along with the errors that prevented them from being imported, the second section has the information of the issues that were successfully imported along with the JIRA issue id, key and self URL. In both section the elementNumber field indicates the index of the test it refers to in the input.
curl -H "Content-Type: application/json" -X GET -H "Authorization: Bearer $token" https://xray.cloud.getxray.app/api/v2/import/test/bulk/34a4106b1d0948d1aae1170cc8df3bb4/status |
Responses 200 OK : application/json : Successful. The job status is available. Example 1: Job is still working {
"status": "working",
"progress": [
"[Tue, 07 Aug 2018 13:54:37 GMT] Preprocessing the information of the 3 tests to import.",
"[Tue, 07 Aug 2018 13:54:37 GMT] Creating 3 issue(s) in JIRA.",
"[Tue, 07 Aug 2018 13:54:39 GMT] Saving additional information of 2 issue(s)."
],
"progressValue": 80
} |
Example 2: Job ended in partial success {
"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 with the given jobId. {
"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. |