---
title: "Test Step Results - REST"
canonical: "https://docs.getxray.app/space/XRAY/301477134/Test%20Step%20Results%20-%20REST"
format: markdown
---
# Test Steps Results

> Macro (toc)

## Test Step

- To view a Test Step, you need to specify the ID of the Test Run and the ID of the test step.
- To update a Test Step, you need to send a JSON with the Test Step fields you want to update.

> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Return a json that represents the test step.
> 
> ### ** **<span style="color: #003366">**Request**</span>** **
> 
> ###### ** **<span style="color: #003366">**PATH **</span><span style="color: #003366">**PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> ### <span style="color: #003366">**Responses**</span>** **
> 
> 200 OK : **text/plain** : Successful. Return a json that represents the test step.
> 
> ##### **Example Output**
> 
> ```
> {
>       "id":729,
>       "index":1,
>       "step":{
>          "raw":"ssaf",
>          "rendered":"<p>ssaf</p>"
>       },
>       "data":{
>          "raw":"asdf",
>          "rendered":"<p>asdf</p>"
>       },
>       "result":{
>          "raw":"asdfasdf",
>          "rendered":"<p>asdfasdf</p>"
>       },
>       "attachments":[
>       ],
>       "status":"EXECUTING",
>       "comment":{
>          "raw":"asdasdasdasdasd",
>          "rendered":"<p>asdasdasdasdasd</p>"
>       },
>       "defects":[
>          {
>             "id":15018,
>             "key":"CALC-115",
>             "summary":"Ad-hoc execution for CALC-93",
>             "status":"Open"
>          }
>       ],
>       "evidences":[
>          {
>             "id":216,
>             "fileName":"1 (24).feature",
>             "fileSize":"0,4 kB",
>             "created":"Wednesday 5:09 PM",
>             "author":"admin",
> 			"fileURL": "http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/1 (24).feature"
>          }
>       ],
> 	  "actualResult":{
> 		"raw":"Actual result",
> 		"rendered":"<p>Actual result</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 getting the test run.


> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Update the test run step. The fields that can be updated on the test run are: **status, comment, defects **and** evidences**.
> 
> Defects and evidences mentioned directly by the respective attributes are always added to the ones that may exist at the step.
> 
> ### ** **<span style="color: #003366">**Request**</span>
> 
> ###### ** **<span style="color: #003366">**PATH **</span><span style="color: #003366">**PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> ##### **Example of input**
> 
> ```javascript
> {
>    "id":"729",
>    "status":"PASS",
>    "comment":"The comment",
>    "defects":[
>       "TEST-114",
>       "TEST-115",
>       "TEST-116"
>    ],
>    "evidences":[
>       {
>          "filename":"test.txt",
>          "contentType":"plain/text",
>          "data":"(BASE64 encoding)"
>       }
>    ],
>    "actualResult":"The actual result"
> }
> ```
> 
> <span style="color: #003366">**Responses**</span>** **
> 
> 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 step.

## Status

- To view the status of a Test Step, you need to specify the ID of the Test Run and the ID of the Test Step.
- To update the status of a Test Step, you need to specify the ID of the Test Run, the ID of the Test Step and the Status that you want the Test Step to have.


> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Return a json that contains the test step status.
> 
> ### ** **<span style="color: #003366">**Request**</span>** **
> 
> ###### ** **** **<span style="color: #003366">**PATH **</span>** **** **<span style="color: #003366">**PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> > ✅ **Example Request**
> > ✅ 
> > ✅ <span style="color: #000000">curl -H "Content-Type: application/json" -X GET -u admin:admin </span>[<span style="color: #000000">http://yourserver/rest/raven/1.0/api/testrun/3/step/2/status</span>](http://yourserver/rest/raven/1.0/api/testrun/3/step/2/status)
> 
> ### <span style="color: #003366">**Responses**</span>** **
> 
> 200 OK  :  **text/plain**  : Successful. Returns the name of the test step Status. 
> 
> ##### **Example Output**
> 
> ```
> 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.

> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Update the test step status.
> 
> ### ** **<span style="color: #003366">**Request**</span>** **
> 
> ###### ** **<span style="color: #003366">**PATH **</span><span style="color: #003366">**PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> ###### <span style="color: #003366">QUERY PARAMETERS</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | status | *String* | - The status we want the test step to have. |
> 
> > ✅ **Example Request**
> > ✅ 
> > ✅ <span style="color: #000000">curl -H "Content-Type: application/json" -X PUT -u admin:admin </span>[<span style="color: #000000">http://yourserver/rest/raven/1.0/api/testrun/3/step/2/status?status=PASS</span>](http://yourserver/rest/raven/1.0/api/testrun/3/step/2/status?status=PASS)<span style="color: #000000"> </span>
> 
> ### <span style="color: #003366">**Responses**</span>** **
> 
> 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 updating the test step status.

## Execution Evidences

- To view the execution evidences of a Test Step, you need to specify the ID of the Test Run and the ID of the Test Step.
- To add a new execution evidence to the Test Run, a JSON is required.
- To delete one or more execution evidences from the Test Run, you need to send a JSON with the file name of the evidence you want to delete. Another way to delete an execution evidence is to specify the evidence ID.


> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Return a json that contains an array with all the execution evidences the test step has.
> 
>  <span style="color: #003366">**Request**</span>** **
> 
> ###### ** **<span style="color: #003366">**PATH PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> ### <span style="color: #003366">**Responses**</span>** **
> 
> 200 OK : **text/plain** : Successful. Returns a json with the test step execution evidences.
> 
> ##### **Example Output**
> 
> ```
> [
>    {
>       "id":216,
>       "fileName":"1 (24).feature",
>       "fileSize":"0,4 kB",
>       "created":"Wednesday 5:09 PM",
>       "author":"admin",
>       "fileURL":"http://YOURJIRA/jira/plugins/servlet/raven/attachment/253/1 (24).feature"
>    }
> ]
> ```
> 
> 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.

> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Add a new evidence to the test step.
> 
> <span style="color: #003366">**Request**</span>** **
> 
> ###### ** **<span style="color: #003366">**PATH PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> ##### **Example Input**
> 
> ```
> {
>    "data":"iVBORw0KGgoAAAANSUhEUgAABkIAAAO9CAYAAADezXv6AAAAAXNSR0IArs4c6QAA(...base64 file enconding)",
>    "filename":"image21.jpg",
>    "contentType":"image/jpeg"
> }
> ```
> 
> ### <span style="color: #003366">**Responses**</span>** **
> 
> 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.

> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Remove all evidences with the same filename from the test step.
> 
> ### <span style="color: #003366">**Request**</span>** **
> 
> ###### ** **<span style="color: #003366">**PATH PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> 
> ##### **Example Input**
> 
> ```
> image.png
> ```
> 
> ### <span style="color: #003366">**Responses**</span>** **
> 
> 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.

> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> Remove the evidence with the given attachment id.
> 
> ### <span style="color: #003366">**Request**</span>** **
> 
> ###### ** **<span style="color: #003366">**PATH PARAMETERS**</span>
> 
> | **parameter** | **type** | **description** |
> | --- | --- | --- |
> | `id` | *Integer* | - id of the test run. |
> | stepResultId | *Integer* | - id of the step. |
> | attachmentId | *Integer* | - id of the attachment we want to delete |
> 
> ###### <span style="color: #003366">**Responses**</span>
> 
> 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.