I use a powershell script to call the azure rest api and add new iterations and delete the three basic iteration.
For the api it work, if i get the list of iterations Iteration 1 to 3 are deleted, however if i go to the GUI there are still here :
Did i miss something ?
Code
function deleteIteration {
[CmdletBinding()] param (
[Parameter( Mandatory )] [string] $organization,
[Parameter( Mandatory )] [string] $project,
[Parameter( Mandatory )] [string] $iteration,
[Parameter( Mandatory )] [hashtable] $header
)
try {
[string] $team = getMainTeamName -organization $organization -project $project
[string] $iterationId = getIterationId -organization $organization -project $project -iteration $iteration -team $team -header $header
[string] $uri = "$url/{0}/{1}/{2}/_apis/work/teamsettings/iterations/{3}?{4}" -f $organization, $project, $team, $iterationId, $apiVersion
[Object] $query = Invoke-RestMethod -Uri $uri -Method Delete -Headers $header
Write-Host "- Iteration $iteration has been deleted !"
} catch {
Write-Host "##[error] An error occurred while deleting Iteration $name at $uri."
Get-Error
throw
}
}

