How to: Including a bunch of Work Items on Azure DevOps

Vinicius Moura
2 min readDec 2, 2021

--

This automation includes a bunch of Work Items on Azure using only four lines

This post represents a quick example that gives you the possibility to include many Work Items from a text file. This text file is separated by “pipe” (|). The sequence of fields that will be used is shown below:

  • Work Item Type
  • Title
  • Team Project
  • Area
  • Iteration

The respective sample text file, as well as the automation, are available on GitHub. The automation code is below:

  1. PowerShell script will receive the following parameters:
  • $PAT = Personal Access token to connect on Azure DevOps;
  • $Organization = Organization URL to connect on Azure DevOps.

2. Read text file = read a file using delimiter ‘|’ and define columns WorkItemType, Title, TeamProject, Area, Iteration.

$data = Import-Csv -Delimiter '|' -Path "$home\desktop\wis.txt" -Header 'WorkItemType','Title','TeamProject','Area','Iteration'

3. az boards work-item create = use this command line to insert Work Items

az boards work-item create 
--title $_.Title
--type $_.WorkItemType
--project $_.TeamProject
--area $_.Area
--iteration $_.Iteration

4. After executing this sample text file, see the results on Azure DevOps:

--

--

Vinicius Moura
Vinicius Moura

Written by Vinicius Moura

Tech Solution Architect Manager na Accenture

No responses yet