Can we export Azure DevOps work item fileds into Excel

9.6k Views Asked by At

We have different types of work items in Azure DevOps Boards. We need to export list of all fields in work items to excel or any similar format. Is there a way to use the APIs to pull a list of all fields in the system and whatever associated metadata is available? Can someone please help us on this task.

3

There are 3 best solutions below

0
On BEST ANSWER

You can use Rest Api to get all fields form process template: https://learn.microsoft.com/en-us/rest/api/azure/devops/processes/fields/list?view=azure-devops-rest-7.1

Powershell example:

$user = ""
$token = "<pat>" #https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))
$orgUrl = "https://dev.azure.com/<org>"
$procId = "<proc-guid>"
$wiRefName = "<wi type name>"

$restApiGetFields = "$orgUrl/_apis/work/processes/$procId/workItemTypes/$wiRefName/fields?api-version=7.1-preview.2"

function InvokeGetRequest ($GetUrl)
{   
    return Invoke-RestMethod -Uri $GetUrl -Method Get -ContentType "application/json" -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
}

$fields = InvokeGetRequest $restApiGetFields

foreach ($wifield in $fields.value)
{
    Write-Host "Name:" $wifield.name "; RefName" $wifield.referenceName
}

Process guild you can get through rest API: https://dev.azure.com/<you_org_name>/_apis/work/processes?api-version=7.1-preview.2

enter image description here

Work Item Type Name you can get from URL while viewing your process template:

enter image description here

UPDATE:

To get information about each field, you need to use FIELD GET rest API with $expand=all option.

Example: enter image description here

0
On

You can use the Azure DevOps Office® Integration 2019 connector for Excel to extract data in volume. There is a limit for calling the API I think it might be 10,000 work items. you can get around this rate limit by dividing your query up when you run it with a criteria.

0
On

If you have Visual Studio, you can run Developer Command Prompt and use witadmin command line.

enter image description here

witadmin listfields /collection:https://dev.azure.com/<org>

Witadmin syntax: https://learn.microsoft.com/en-us/azure/devops/reference/witadmin/manage-work-item-fields?view=azure-devops#syntax