Skip to content

Instantly share code, notes, and snippets.

@codebytes
Last active August 14, 2023 20:56
Show Gist options
  • Save codebytes/6291931f4ab5fd160304b6d6735cef29 to your computer and use it in GitHub Desktop.
Save codebytes/6291931f4ab5fd160304b6d6735cef29 to your computer and use it in GitHub Desktop.
export-ado-workitems.sh
#!/bin/sh
org=https://dev.azure.com/ChrisAyersFTA
project=Sample
saName=cayersadotestsa
saContainer=ado
az extension add --name azure-devops --upgrade -y
az devops project list --org=$org -o table
# az boards query --wiql "SELECT [System.Id], [System.Title], [System.AssignedTo], [System.State], [System.AreaPath], [System.IterationPath], [System.Tags], [System.CommentCount] FROM workitems WHERE [System.TeamProject] = '${project}' ORDER BY [System.IterationPath]"
ids=$(az boards query --wiql "SELECT [System.Id] FROM workitems WHERE [System.TeamProject] = '${project}' ORDER BY [System.IterationPath]" \
--query '[].id' \
--output tsv)
mkdir -p workitems
for id in $ids
do
az boards work-item show --id $id -o json > workitems/$id.json
done
az storage blob upload-batch --account-name $saName -d $saContainer -s workitems/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment