Forum Discussion

apuna12's avatar
apuna12
Occasional Contributor
4 years ago

Add a new Test Cases into Newly created Test Cycle via API

Hello all,

 

I would like to know how should I add a new test cases into created Test Cycle. 

In short I already created a test cycle through API, now I want to add a new test cases into the cycle. Note that the whole project is new so no test are present.

 

This is what I want to do. I have several API tests in my Java project. Before the run I create the test cycle (which is working fine), after the creation I execute those API tests and after that I would like to create the text case into the previously created test cycle and send the status (pass or fail).

 

I am getting the API endpoints from the following site:

https://zfjcloud.docs.apiary.io/#reference/execution/add-tests-to-folder/create-execution

 

 

Is it possible in that way?

Is there an option to do that?

How can I create these test cases in the test cycle?

 

PS: I use Postman for now

 

 

Thanks for the tips

2 Replies

  • Raymond's avatar
    Raymond
    New Contributor

    techGuy​ 

    Zephyr Scale Cloud does not provide an API endpoint to “add a test case into a test cycle” directly.

    The way to do it is by creating a Test Execution that references both the test cycle and the test case.

    Flow:

    1. Create the test case (if it doesn’t exist yet).
    2. Create a test execution:

    POST /v2/testexecutions { "testCaseKey": "MYPROJ-TC1", "testCycleKey": "MYPROJ-TC123", "statusName": "Pass" }

    This call automatically associates the test case with the test cycle and records its execution result.

    That’s the only supported method as i know

  • hi apuna12​, did you get any solution to add test cases in a test cycle through API?

    let me know in the reply if you get any,  because I'm also looking for that