TestProject Forum

Create work item when a test / step fails

To complete my CI\CD\CT cycle, I want to create a bug (Azure DevOps) whenever a test or a step fails. This way I can assign my QA team to fix the bug / redirect it to a developer.
Is there a way to do so? I’ve searched the documentation but couldn’t find the answer.

Hello @ido_dvir,

You can group all of the steps in your test into one subtest:

Pick a name for it, and then go to the advanced settings of the step, and add a recovery test for it, which will execute only when your tests fails, and then the recovery test will just be a test with an API request to Azure to open a bug:

You can use our RESTful API client addon for that.

1 Like

Hi Artem,
Thank you for the answer. In the last step, I’m trying to call the Azure DevOps API, but I’m getting an error:
java.util.concurrent.ExecutionException: io.testproject.java.sdk.v2.exceptions.FailureException: Failed to create URI
Caused by io.testproject.java.sdk.v2.exceptions.FailureException: Failed to create URI

The URL that I’m using is https://dev.azure.com///_apis/wit/workitems/$bug

It works with Postman

Hello @ido_dvir,

Can you reach out to us on Intercomm or support mail so we can debug this more easily?