Page History
Settings
Some settings can be exported using the REST API.
This page provides a list of the available endpoints available for managing Xray related settings.
Table of Contents | ||
---|---|---|
|
Test Statuses
To obtain a list of all Test (Run) Statuses, including the default ones
...
, you just need to
...
invoke the following endpoint.
Expand | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
Expand | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
400 BAD_REQUEST : text/plain : Returns the error. 401 UNAUTHORIZED : text/plain : The Xray license is not valid. 500 INTERNAL SERVER ERROR : text/plain : An internal error occurred getting the test run. | ||||||||||||||||||||||||
Expand | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
Panel | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
parameter | type | description | ||||||||||||||||||||||
id | integer | - ID of the test run. |
Code Block | ||
---|---|---|
| ||
{
"status": "FAIL",
"comment": "new comment",
"defects": {
"add": [
"test-114",
"test-115",
"test-116"
]
},
"evidences": {
"add": [{
"filename": "test1.txt",
"contentType": "plain/text",
"data": "(base64 encoding...)"
}, {
"filename": "test2.txt",
"contentType": "plain/text",
"data": "(base64 encoding...)"
}],
"remove": ["254", "443"]
},
"examples": [{
"id": "1379",
"status": "TODO"
}]
} |
Code Block | ||
---|---|---|
| ||
{
"status": "FAIL",
"comment": "new comment",
"defects": {
"add": [
"test-114",
"test-115",
"test-116"
]
},
"evidences": {
"add": [{
"filename": "test1.txt",
"contentType": "plain/text",
"data": "(base64 encoding...)"
}, {
"filename": "test2.txt",
"contentType": "plain/text",
"data": "(base64 encoding...)"
}],
"remove": ["254", "443"]
},
"steps": [{
"id": "731",
"status": "TODO",
"comment": "the comment 1"
}, {
"id": "730",
"status": "PASS",
"defects": {
"add": [
"test-114",
"test-115",
"test-116",
"appId=a364a9c7-9ac0-3183-9175-353c1331692a&issue=SDP-5"
]
},
"evidences": {
"add": [{
"filename": "test1.txt",
"contentType": "plain/text",
"data": "(base64 encoding...)"
}, {
"filename": "test2.txt",
"contentType": "plain/text",
"data": "(base64 encoding...)"
}],
"remove": ["274", "543"]
}
}]
} |
Code Block | ||
---|---|---|
| ||
{
"status": "FAIL",
"defects": {"add":["appId=a364a9c7-9ac0-3183-9175-353c1331692a&issue=SDP-5"], "remove":["DCW-9", "appId=a364a9c7-9ac0-3183-9175-353c1331692a&issue=SDP-1"]},
"evidences": [],
"steps": [
{
"id": 43,
"status": "PASS",
"comment": "",
"defects": {"add":[], "remove":["DCW-9"]},
"evidences": []
},
{
"id": 44,
"status": "FAIL",
"defects": {},
"evidences": []
},
{
"id": 45,
"status": "FAIL",
"defects": {},
"evidences": []
}
]
} |
Tip | ||
---|---|---|
| ||
curl -H "Content-Type: application/json" -X PUT -u admin:admin --data @example.json http://yourserver / rest/raven/1.0/api/testrun/1 |
Responses
200 OK : text/plain : Successful.
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred updating the test run.
Status
...
Test Step Statuses
To obtain a list of all Tes Step Statuses, including the default ones, you just need to invoke the following endpoint
...
.
Expand | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||
Panel | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
parameter | type | description | |||||||||||||||||||||||
id | integer | - ID of the test run. | |||||||||||||||||||||||
Tip | |||||||||||||||||||||||||
|
Code Block | ||
---|---|---|
| ||
PASS |
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the test run status.
title | PUT /rest/raven/1.0/api/testrun/{id}/status |
---|
settings/teststepstatuses |
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
parameter | type | description |
---|---|---|
id | integer | - ID of the test run. |
QUERY PARAMETERS
title | Example Request |
---|
Responses
200 OK : text/plain : Successful.Returns
the error.401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when updating the test run status.
Execution defects
- To view the defects of a Test Run, you need to specify the ID of the Test Run.
- To add a new defect to the Test Run, a JSON with an of issue keys is required.
- To delete one or more defects from the Test Run, you need to specify the key of the issue you want to delete.
| ||||||||||||||||||||||
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
Responses200 OK : text/plain : Successful. Returns a json with the test run defects.
400 BAD_REQUEST : text/plain : Returns the error. 401 UNAUTHORIZED : text/plain : The Xray license is not valid. 500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the test run defects. |
Expand | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
|
Expand | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
|
Execution Evidences
...
|
...
|
...
title | GET /rest/raven/1.0/api/testrun/{id}/attachment |
---|
...
borderColor | #ccc |
---|---|
borderStyle | solid |
Return a json that contains an array with all the execution evidences the test run has.
Request
PATH PARAMETERS
...
- id of the test run.
...
title | Example Request |
---|
...
|
Responses
200 OK : text/plain : Successful. Returns a json with the test run execution evidences.
Code Block | ||
---|---|---|
| ||
[
{
"id":253,
"fileName":"TestdataPoorPerfomance.csv",
"fileSize":"35 kB",
"created":"2016-10-24T15:50:57+01:00",
"author":"admin",
"fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/TestdataPoorPerfomance.csv"
},
{
"id":254,
"fileName":"testfile.txt",
"fileSize":"35 kB",
"created":"2016-10-24T16:50:57+01:00",
"author":"admin"
"fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/254/testfile.txt"
}
] |
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the evidences.
...
title | POST /rest/raven/1.0/api/testrun/{id}/attachment |
---|
...
borderColor | #ccc |
---|---|
borderStyle | solid |
Add a new evidence to the test run.
Request
PATH PARAMETERS
...
- id of the test run.
Example
Code Block | ||
---|---|---|
| ||
{
"data":"iVBORw0KGgoAAAANSUhEUgAABkIAAAO9CAYAAADezXv6AAAAAXNSR0IArs4c6QAA(...base64 file enconding)",
"filename":"image21.jpg",
"contentType":"image/jpeg"
} |
Tip | ||
---|---|---|
| ||
curl -H "Content-Type: application/json" -X POST -u admin:admin --data @example.json http://yourserver / rest/raven/1.0/api/testrun/2/attachment |
Responses
200 OK : text/plain : Successful.
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when inserting the evidences.
...
title | DELETE /rest/raven/1.0/api/testrun/{id}/attachment |
---|
...
borderColor | #ccc |
---|---|
borderStyle | solid |
Remove all evidences with the same filename from the test run.
Request
PATH PARAMETERS
...
- ID of the test run.
Example
Code Block | ||
---|---|---|
| ||
image.png |
...
title | Example Request |
---|
...
Responses
200 OK : text/plain : Successful.
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when deleting the evidences .
...
title | DELETE /rest/raven/1.0/api/testrun/{id}/attachment/{attachmentid} |
---|
...
borderColor | #ccc |
---|---|
borderStyle | solid |
Remove the evidence with the given attachment id.
Request
PATH PARAMETERS
...
- id of the test run.
...
- id of the attachment we want to delete.
...
title | Example Request |
---|
...
Responses
200 OK : text/plain : Successful.
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when deleting the evidences.
Comment
- To view the comment of a Test Run, you need to specify the ID of the Test Run.
- To update the comment, you need to send a JSON with the comment that you want the Test Run to have.
...
title | GET /rest/raven/1.0/api/testrun/{id}/comment |
---|
...
borderColor | #ccc |
---|---|
borderStyle | solid |
Return a json that contains the test run comment in raw and rendered state.
Request
PATH PARAMETERS
...
- id of the test run.
...
title | Example Request |
---|
...
Responses
200 OK : text/plain : Successful. Returns a json with the test run comment.
Code Block | ||
---|---|---|
| ||
{
"raw":"this is the test run comment.",
"rendered":"<p>this is the test run comment.</p>"
} |
400 BAD_REQUEST : text/plain : Returns the error.
401 UNAUTHORIZED : text/plain : The Xray license is not valid.
500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the test run comment.
Expand | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||
|
Examples
- To view all examples of a Test Run, you need to specify the ID of the Test Run.
- To view or edit a specific test example, check out Test Examples - REST
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
400 BAD_REQUEST : text/plain : Returns the error. 401 UNAUTHORIZED : text/plain : The Xray license is not valid. 500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the test run examples. |
Test Steps
...
|
...
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
400 BAD_REQUEST : text/plain : Returns the error. 401 UNAUTHORIZED : text/plain : The Xray license is not valid. 500 INTERNAL SERVER ERROR : text/plain : An internal error occurred when getting the test run stepstest step statuses. |