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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in DevOps

CI/CD in Open DevOps

Two weeks left in our Open DevOps partner spotlight - and we’re excited to be shining a light on CI/CD. A foundational piece of DevOps, CI/CD needs no introduction… but we’ll give one anyways! Cont...

793 views 2 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you