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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Sid I'm New Here Jun 07, 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

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

Step up your DevOps game webinar Q&A series - Questions answered!

  On October 21st, 2020 we hosted a webinar titled,   Step Up You DevOps Game with 4 Key Integrations for Jira and Bitbucket. We had a great showing and high engagement, but that meant th...

103 views 0 1
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