Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to update the Test Execution result of a particular Test Step within it using REST api?

Sid
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 7, 2020

Hi,

I'm trying to update the Test Execution result of a particular Test Step within it using REST api. I referred the Test Step Results - REST documentation, however, the solution doesn't produce the output that I expect. Here are the detailed steps that I followed:

  1. Created a Test Execution using REST.
    Request: curl -H "Content-Type: application/json" -X POST -u admin:admin --data @test-execution.json http://{XRAY-Server}/rest/raven/1.0/import/execution
    Response: {"testExecIssue":{"id":"48033","key":"XRAYT-362","self":"http://{XRAY-Server}/rest/api/2/issue/48033"}}
  2. Update the same Test Execution for a particular Test Step
    JSON: test-execution-update.json
    {
       "id":"48033",
       "status":"FAIL",
       "comment":"Expected '5' to equal '10'.",
       "evidences":[
          {
             "data":"iVBORw0KGgoAAAANSUhEUgAA..[base64-image]",
             "filename":"screenshot.png",
             "contentType":"image/png"
          }
       ],
       "actualResult":"The actual result for 1177"
    }

    Request: curl -H "Content-Type: application/json" -X PUT -u admin:admin --data @test-execution-update.json http://{XRAY-Server}/rest/raven/1.0/api/testrun/48033/step/1176/
    Response: Test Run with Id 48,033 was not found in the server

As you can see the Test Run id is used later is same as was generated by the earlier response. So it's weird to get such response.

Has anyone faced such issue? Any help would be much appreciated.
Thanks in advance :)

 

Regards,
Siddhesh Malpani

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
José Domingues [Xray]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 16, 2020

Hi @Sid , 

The ID that you're using is the Issue Id of the Test Execution, not the Test Run ID.
To fetch the Test Run ID, please follow the guide of our support documentation: https://confluence.xpand-it.com/display/public/XRAY/Test+Runs+-+REST

If you have any questions, please contact our support service desk.

Best Regards,

Team Xray

TAGS
AUG Leaders

Atlassian Community Events