AzureOrganization="https://dev.azure.com/ExampleOrganization"
AzureProject="ExampleProject"
az devops configure -d organization= $AzureOrganization project=$AzureProject
read-r-p "Enter name of iteration" iteration
echo @ iterationname
If @ iteration exists in the organization project , then perfect if @ iteration does not exist, print out this iteration does not exist in the project
read-r-p "Enter name of team in the organization that you want to link in the iteration " team
echo @ team
If @ team exists in the organization project , then perfect if @ team does not exist,print out this team does not exist in the project
So how do I know whether the team or Iteration already existed in Azure Devops Organization?
To determine if a team exists, you can use
if the team exists,
$teamwill have JSON in it, otherwise not.To determine if an iteration exists, you can use
Look at your project iteration structure for how to structure the query to the path. My iteration tree is 4 levels deep. Yours may not be. If the iteration exists,
$iterationwill have JSON in it, otherwise not.The
2>/dev/nullsuppresses the stderr output from the CLI when the iteration or team does not exist.--only-show-errorsdoes not suppress this.The
ifstatements may vary from shell to shell (I usezsh), so if this does not work you may need to look at documentation for the shell you're using.