Forum Discussion

marmes42's avatar
marmes42
New Contributor
2 years ago

Can the default status be updated via REST API?

When attempting to change the "Not Executed" status of a Test Case to "Pass" via "https://api.zephyrscale.smartbear.com/v2/statuses/{statusId}" the following errors is returned.

 

{"errorCode":400,"message":"The name of default statuses cannot be changed."}

{"errorCode":400,"message":"The index field cannot be changed."}

{"errorCode":400,"message":"A status of this type with this name already exists."}

 

I tried multiple way of to get statuses to work properly.

- archived defaults

- added my own statuses

- rearranged own statuses ahead of defaults

 

The only way I can change status via REST API is to first change to own status via web UI, then update via REST API. However, the web UI indications did not work properly. There's not enough detail in the documentation to determine the proper way of updating Test Executions.

 

  • MisterB's avatar
    MisterB
    Champion Level 3

    My understanding of the API documentation is that the Statuses endpoint is used to update the  Statuses available for use within Scale, e.g. I want to rename a custom Status that has the Name "Re-work" to "Backlog".

     

    To update test results (which would contain the status of a result) you need to use the Test Executions endpoint, and you'll see that that endpoint does not have a POST endpoint.  So unfortunately, the short answer is: you cannot update test results using the API - you can only create (or retrieve) them.

     

  • marmes42's avatar
    marmes42
    New Contributor
    Hi,

    This makes no sense...

    Why would you provide a PUT endpoint that does not allow updates?

    It's a simple update from "Not Executed" to "Pass", "Fail", or "Blocked" based on automated Test Environment results.

    Perhaps we have a misunderstanding? Is there a point person that I could talk too in order to resolve this issue?

    Thank you,
    Mike


    Michael Armes
    Sr. Quality Assurance Engineer
    marmes@ambri.com
    [signature_2034873229]

    Batteries for clean energy
  • MisterB's avatar
    MisterB
    Champion Level 3

    Lol, no worries Mike.  You're currently communicating with other users of Scale.  If you want a definitive answer from SmartBear, I've put a link to their Support portal below.

     

    SmartBear Support

     

    Also, I just noticed a typo on my original reply: POST should read PUT - there is no capability to update existing test execution results using the Test Executions endpoint, e.g. changing a test execution result from Not Executed to Pass.  You can only use the POST endpoint to create test executions (and apply an execution status at the same time).  At the risk of digging myself deeper into a lack-of-knowledge hole... I think some of the confusion may be lifted by thinking of test execution statuses as actually being test execution results.  Results and Statuses are different.  My interpretation of the Statuses API endpoint, is that it is there to help manage all the different statuses that can be created throughout Scale - it's not at all related to test execution results.  But, I am not a big user of the API and I'd be happy to learn if my understanding is not correct - please do share.

     

    Good luck!

     

    Andy