咨询:能否将含链接、子项、附件的Azure DevOps工作项导出至Excel?
Absolutely, you can export all your Azure DevOps work item data—including links, child items, attachments, and more—to Excel, though the approach depends on how much detail you need and whether you want automation. Here are the most reliable methods:
This is the easiest way for most users, and it works directly from Azure DevOps:
- Go to your project's Boards > Queries and create a query that includes all the work items you need. For child items, use a Tree query to include parent-child hierarchies.
- Run the query, then click the Export to Excel button in the top menu.
- In the export options, make sure to select all relevant fields:
- For links: Add columns like
Related Work Itemsor specific link types (e.g., "Parent", "Child"). - For attachments: Include the
Attachmentscolumn (this will show attachment names/links, not the actual files).
- For links: Add columns like
- Once exported, you can format the Excel sheet to highlight hierarchies (e.g., indent child items) or add filters.
Important note: Excel can’t embed actual attachment files—you’ll need to download attachments separately from Azure DevOps (via the work item details page) and link to their local paths in Excel if needed.
If you need more control over the data structure or want to refresh the export automatically later, use Excel’s Power Query:
- Open Excel, go to the Data tab > Get Data > From Azure DevOps (or search for it in the "From Other Sources" menu).
- Enter your Azure DevOps organization URL and project name, then authenticate.
- Select the work items you want to import, then load the data into the Power Query Editor.
- In the editor, you can:
- Expand the
Relationscolumn to extract parent/child links and other related work item details. - Add a custom column to pull attachment URLs or metadata using Azure DevOps REST API endpoints.
- Clean up and format the data (e.g., split link types, organize hierarchies).
- Expand the
- Load the transformed data into Excel—you can then refresh it anytime to get the latest work item updates.
For complete customization (like bulk downloading attachments alongside work item data), use the Azure DevOps REST API with a script (PowerShell, Python, etc.):
- First, generate a personal access token (PAT) in Azure DevOps with Work Items Read and Attachments Read permissions.
- Use the API endpoint
https://dev.azure.com/{organization}/{project}/_apis/wit/workitems?ids={comma-separated-ids}&$expand=Allto fetch all work item details, including relations, attachments, and child items. - Parse the API response to extract the fields you need (e.g., work item ID, title, parent ID, attachment URLs).
- For attachments, loop through each attachment URL and download the files to a local folder using the PAT for authentication.
- Use a library like
ImportExcel(PowerShell) orpandas(Python) to write the work item data (including attachment local paths) to an Excel file.
This method lets you automate the entire process and keep attachments linked directly to your Excel data.
内容的提问来源于stack exchange,提问作者Nanab4u

