Forum Discussion

ptoms's avatar
ptoms
Copper Contributor
Oct 05, 2023

Extract Test Steps from test Plan using API

Is there any way to get data from the "STEPS" Field under Test Case using API or OData Feed? 

I am trying to connect with PowerBI and extract all the data under the "Steps" Field in a Test Case / Test Suite / Test Plan 

https://learn.microsoft.com/en-us/rest/api/azure/devops/test/points/get-points-by-query?view=azure-devops-rest-7.2&tabs=HTTP

1 Reply

  • How about using REST API:

     

    To stored as XML in the Microsoft.VSTS.TCM.Steps field of a Test Case work item

     

    API Endpoint

    GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1



    •    In the response, check the fields object for: 

    "Microsoft.VSTS.TCM.Steps": "<steps id=\"0\">...</steps>"


    •    This XML contains all the test steps, including inputs and expected results.

    Connecting to Power BI
    Power BI doesn’t natively parse XML from REST API responses, so you may need to:
    1.    Use Power Query to call the REST API
    2.    Extract and parse the Microsoft.VSTS.TCM.Steps field
    3.    Use custom logic to transform the XML into tabular format

Resources