简体   繁体   中英

Azure DevOps - How to receive title of work items (product backlog items) in query api?

I could not find any direct API which can be called with tag as input and returns all the items associated with that tag so i created a query in UI and calling this query using this api call:

https://dev.azure.com/{Org}/{Project}/_apis/wit/wiql/{queryId}?api-version=6.0

But it is only returning item id and url, i want title as well in the response, how can this be done ?

Yes, the REST API for Wiql cannot directly the titles of the work items.

As a workaround, you can try like as below:

  1. Install the " Wiql to OData " extension to your Azure DevOps organization.

  2. Open the work item query you created. Make sure you have added the Title column on the query page.

    在此处输入图像描述

  3. Open the menu list of on the query page, and select the option " Translate To OData ". From the pop-up window, you can see the OData query translated from the Wiql. You can edit the OData query (if require). Then click the "Copy query" button to copy the OData query.

    在此处输入图像描述

  4. Use the GET method to call the OData query. From the returned result, you can see the titles of the work items.

    在此处输入图像描述

For more details, you can reference the following documents:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM