Replies: 2 comments
-
Hi there, This looks to be a complex issue that you will need to debug locally to figure out what is going on. Debug in Visual Studio Steps:
Your assistance is greatly appreciated! Thanks, Azure DevOps Migration Tools team |
Beta Was this translation helpful? Give feedback.
0 replies
-
No clue from this... but you will likely need to run a Visual Studio session and add some breakpoints to see where the issue is. Funding for us doing work on this tool is generally through 1) customer funding, or 2) donated free time. We love pull requests. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am migrating Test Plans and Suites. Tried to follow the guide- https://nkdagility.com/learn/azure-devops-migration-tools/howto/migrating-plans-and-suits/. For the first step, i didn't manage to run using Field Map that will copy ReflectedWorkItemId to Microsoft.VSTS.Build.IntegrationBuild, i used the powershell script found from another thread-
`Function Update-Field {
$body = "[{$ ($body -f 'Custom.ReflectedWorkItemID',$testCase.fields.'Microsoft.VSTS.Build.IntegrationBuild')}]"
$addTag = "{$ ('"op": "add","path": "/fields/System.Tags","value": "{0}"' -f $testCase.fields.'Microsoft.VSTS.Build.IntegrationBuild')}"
$body = "[{$ ($body -f 'Microsoft.VSTS.Build.IntegrationBuild',$testCase.fields.'Custom.ReflectedWorkItemID')},$addTag]"$authToken "$ ($testCase.url)?api-version=6.0" -Body $body -ContentType 'application/json-patch+json'
Param (
$body,
$field,
$testCase,
$authToken,
[switch]$dryRun
)
switch ($field) {
"Custom.ReflectedWorkItemID" {
Write-Host "Updating $field"
}
"Microsoft.VSTS.Build.IntegrationBuild" {
Write-Host "Updating $field"
}
}
if ($dryRun) {
Write-Host "Dry Run: Would send the following PATCH request:"
Write-Host "URL: $($testCase.url)?api-version=6.0"
Write-Host "Headers: $authToken"
Write-Host "Body: $body"
} else {
Invoke-RestMethod -Method Patch -Headers
}
}
Function Update-TestCases {
Param (
$targetSubscription,
$targetProject,
$logpath,
[switch]$dryRun
)
try {
$devOpsWI = '{0}/{1}/{1} Team/_apis/wit/wiql?api-version=5.1' -f $targetSubscription, $targetProject
$body = "{
"query
":"Select * From WorkItems Where [System.TeamProject] = '$targetProject' AND [System.WorkItemType] = 'Test Case'
"}"$_devOpsCases = (Invoke-RestMethod -Method Post -Headers $authToken -Body $body $devOpsWI -ContentType 'application/json').WorkItems
$count = 0
foreach ($devOpsCase in $_devOpsCases) {
Write-Host -ForegroundColor Yellow ('{0} - {1}' -f $devOpsCase.id, $devOpsCase.url)
Add-Content -Path $logpath -Value ('{0} - {1}' -f $devOpsCase.id, $devOpsCase.url)
$testCase = (Invoke-RestMethod -Method Get -Headers $authToken ($devOpsCase.url))
$intBuild = $testCase.fields.'Microsoft.VSTS.Build.IntegrationBuild' -ilike "https*"
$CustRef = $testCase.fields.'Custom.ReflectedWorkItemID' -ilike "https*"
$body = '"op": "add","path": "/fields/{0}","value": "{1}"'
if ($intBuild -and $CustRef) {
if ($testCase.fields.'Microsoft.VSTS.Build.IntegrationBuild' -eq $testCase.fields.'Custom.ReflectedWorkItemID') {
Write-Host "Mapping URLs Match"
Add-Content -Path $logpath -Value "Mapping URLs Match"
}
}
elseif (!$CustRef -and $intBuild) {
Update-Field -body $body -field "Custom.ReflectedWorkItemID" -testCase $testCase -authToken $authToken -dryRun:$dryRun
Add-Content -Path $logpath -Value "Updated Custom.ReflectedWorkItemID"
}
elseif ($CustRef -and !$intBuild) {
Update-Field -body $body -field "Microsoft.VSTS.Build.IntegrationBuild" -testCase $testCase -authToken $authToken -dryRun:$dryRun
Add-Content -Path $logpath -Value "Updated Microsoft.VSTS.Build.IntegrationBuild"
}
Write-Host -ForegroundColor Green "$count/$($devOpsCases.Count)"
$count++
}
}
Catch {
Write-Host -ForegroundColor Yellow "Issue Found: $"
}
}
Set up the authentication token
$PAT = "" # Replace with your Azure DevOps PAT
$global:authToken = $ ([Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "", $PAT))))
$global:authToken = @{Authorization = ("Basic {0}" -f $authToken) }
Call the Update-TestCases function
Update-TestCases
-targetSubscription "https://dev.azure.com/Org/"
-targetProject ""
-logpath C:\temp\output\UpdateFields.logs
#-DryRun # Remove -DryRun to apply changes`
For second step, some shared parameters migrated successfully, but there are like below-
any idea what could be the issue here?
Beta Was this translation helpful? Give feedback.
All reactions