Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-10742

When a Test Run has only one iteration, the REST API to get Test Steps is not working

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Xray DC - v.7.10.4
    • Continuous Delivery
    • REST API
    • None
    • Support

    • Xray 2025 S3
    • UNCOVERED

    Description

      Description

      When a Test Run has only one iteration, the REST API to get Test Steps is not working.

      Use case:

      • Consider a Test where you only create one parameter and with only one value -> One iteration.
      • When performing the REST API to get a specific Test Run, the JSON returned will have the parameters data but no iteration information, as we have documented:

      • However, when using the Get Steps API, it returns an error stating that there is an iteration and that, therefore, another endpoint is necessary, which is OK.

      • The problem is that to use the necessary endpoint, it is also necessary to have the Iteration ID, and this value is not retrieved in the Test Runs API. So, the only solution is to get this value directly via the HAR file.

      How to reproduce

      1. Create a Test and add a dataset with only one iteration
      2. Execute this Test - Check that in the Test Run page there is only one single iteration.
      3. Use the API /rest/raven/2.0/api/testrun?testExecIssueKey=TEST-5&testIssueKey=TEST-2 and get the JSON. No information about iteration is presented.
      4. Use the API to get some particular step /rest/raven/2.0/api/testrun/2/step/2
      5. An error is thrown:

      Actual result/Attachments

      The API to get a particular Test Step cannot be directly used when having only one iteration.

      Cannot perform this operation, because the Test Run has iterations. Please use another endpoint for it.
      

      Expected result

      Since when having a single iteration it is considered a normal run, the Test Steps should be automatically retrieved via Test Step API. It should not be necessary to get the Iteration ID and use the endpoint /rest/raven/2.0/api/testrun/4/iteration/3/step/7

      Version

      • 7.10.4

      Workaround
      Get the Iteration ID, navigate to the Test Run page, open the Network tab from the Dev Console, refresh the page, and search by iteration

      Attachments

        1. screenshot-1.png
          screenshot-1.png
          47 kB
        2. screenshot-2.png
          screenshot-2.png
          146 kB
        3. screenshot-3.png
          screenshot-3.png
          105 kB
        4. screenshot-4.png
          screenshot-4.png
          10 kB
        5. screenshot-5.png
          screenshot-5.png
          42 kB
        6. screenshot-6.png
          screenshot-6.png
          92 kB

        Activity

          People

            dpca Diamantino Campos
            amgt Ana Teixeira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: