Comments (3)
Hi @tdashworth. We were getting this a lot as well. In the end I added a retry to the Merge-SolutionMerge.ps1 script and it resolved it. I need to feed that change back into the sample here. Never got to the bottom of what's going on. Perhaps Azure DevOps is automatically linking the work item to the extract pipeline at the same time as we're trying to link the work item to the pull request?
from development-hub.
Hi, @tdashworth. Sorry I've been slow to respond to this. I'm sure you've sorted something out yourself by now. This is what we've got. It's a little agricultural, but it works -
if ($solutionMerge.devhub_Issue.devhub_azuredevopsworkitemid) {
Write-Host "Linking pull request to work item $($solutionMerge.devhub_Issue.devhub_azuredevopsworkitemid)"
$success = $false
$attempt = 1
while (!$success) {
try {
$result = Invoke-RestMethod `
-Uri "https://dev.azure.com/$org/$project/_apis/wit/workItems/$($solutionMerge.devhub_Issue.devhub_azuredevopsworkitemid)?api-version=4.0-preview" `
-Headers @{ 'authorization' = "Bearer $env:SYSTEM_ACCESSTOKEN"; 'content-type' = 'application/json-patch+json' } `
-Method PATCH `
-Body (ConvertTo-Json -Depth 100 @(
@{
op = 'add';
path = '/relations/-';
value =
@{
rel = "ArtifactLink";
url = $($result.artifactId)
attributes = @{
name = "Pull Request"
}
}
}
)
)
$success = $true
}
catch {
if ($attempt -lt 3) {
Write-Warning "Failed to link pull request to work item on attempt $attempt of 3."
Start-Sleep -Seconds 5
$attempt++
}
else {
throw
}
}
}
}
}
from development-hub.
I've spent some time this evening exploring this and my guess is when committing with a work item, ADO will auto-link it which might be the conflicting change.
Could you share your updated version if it's working well? 😄
from development-hub.
Related Issues (20)
- Flow will never start.. HOT 1
- Support for Azure DevOps Server
- Work item ID requirement should be configurable HOT 1
- Development solution imports that fail after 2 minutes needlessly retry for an hour HOT 1
- Pull requests created with merge conflicts when source branch is provided
- Extract pipeline occasionally stuck on exporting solution
- Setup should be simplified
- Failed to create solution merge commit flow HOT 1
- Signing in to Azure DevOps across tenants
- Specify a Solution Package mapping file to exclude mapped components
- Solution merge stuck on 'Merging' when the source branch has conflicts with the target branch
- Ribbon button to open the development solution HOT 2
- Extract Pipeline can't be ran due to validation errors HOT 5
- Cloning into folders which have spaces in the path HOT 1
- Conflicts reported when two development solutions contain an entity as a container only
- Allow Solution Merge Approver to confirm Manual Steps are complete HOT 1
- Solution Merge: Awaiting Changes status
- TypeScript does not build as part of PrepareDevelopmentEnvironment task
- Master environment per solution merge
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from development-hub.