Forum Discussion

ericbautista's avatar
ericbautista
New Contributor
3 years ago
Solved

Is there a way to preserve the test case order in which they appear when adding them to test cycle ?

Whenever I create a Test Cycle and add the required Test Cases, all of them appear in a random order. The test case order in which they were created is not respected and it is relevant for test execu...
  • josh42's avatar
    josh42
    3 years ago

    Hi ericbautista ,

     

    don't know, if this is an option for you, but you can create test cycles using the API. You can then specify the order of the test cases in the JSON body of the POST request for the test cycle creation.

    https://support.smartbear.com/zephyr-scale-server/api-docs/v1/

    The endpoint to use is .../jira/rest/atm/1.0/testrun/ (POST) and the body would look something like this.

    {
      "projectKey": "TESTMNGT",
      "name": "Test Cycle",
      "items": [
        {"testCaseKey": "I017058-T3069"},
        {"testCaseKey": "I017058-T2880"},
        {"testCaseKey": "I017058-T2878"},
        {"testCaseKey": "TFREP-T12"},
        {"testCaseKey": "TFREP-T186"},
        {"testCaseKey": "TFREP-T187"},
        {"testCaseKey": "I017058-T309"},
        {"testCaseKey": "I017058-T313"},
        {"testCaseKey": "I017058-T2640"},
        {"testCaseKey": "I017058-T9057"},
        {"testCaseKey": "I017058-T1360"},
        {"testCaseKey": "I017058-T315"},
        {"testCaseKey": "I017058-T11851"},
        {"testCaseKey": "I017058-T14865"},
        {"testCaseKey": "I017058-T9054"},
        {"testCaseKey": "I017058-T14869"},
        {"testCaseKey": "I017058-T2879"},
        {"testCaseKey": "I017058-T14895"},
        {"testCaseKey": "I017058-T264"},
        {"testCaseKey": "I017058-T11988"},
        {"testCaseKey": "TFREP-T13"},
        {"testCaseKey": "I017058-T16245"},
        {"testCaseKey": "I017058-T4022"},
        {"testCaseKey": "I017058-T1517"},
        {"testCaseKey": "I017058-T6939"}
      ]
    }

    The test cases are then added to the created test cycles in exactly the order they are in the list paased in the JSON body of the POST request. So you could write a script using this endpoint to create your test cycles and ensure the order is exactly as you want it.

     

    Maybe this helps. 🙂

    Cheers

    Josh