Is it possible to leverage TFS or TS REST api to obtain details for a GIT commit by leveraging the work item commit "ArtifiactLink" url?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Authentication Failure using Git-LFS Azure DevOps
- Getting error: File extension specified '.webt
- “No test result files matching **/*.trx were found
- Azure Graph 403 Authorization_RequestDenied using
相关文章
- Build errors of missing packages in Visual Studio
- VSTS continuous integration triggers not working
- Close a work item via the commit message
- Increment variable value in TFS build +1
- Can't check in changes to TFS
- Running Jasmine tests on Azure DevOps as part of a
- Azure Active Directory: Add Service Principal to D
- Setup team or users permissions with VSTS REST API
So you want to get detail commit information based on a work item artifacts link (while the artifact link type contains commit).
You can achieve that with two REST API, detail steps as below:
1. Get the work item with full expanded
For TFS2015, the format looks like:
For VSTS, the format looks like:
2. Get commit(s) and related repo(s) linked in the above work item
Search in the response of the step1 REST API, get the part which
rel
isArtifactLink
and theurl
start withvstfs:///Git/Commit
. The URL format isSuch as part of the REST API response as:
The project ID is
b959f22b-eeb7-40dc-b37e-986377eaa86f
, the repo ID is2F4cfde261-fec3-451c-9d41-a400ba816110
and the commit ID isb3c3c5b8718f403402be770cb3b5912df7c64dd6
.3. Get commit(s) details
Use the project ID, repo ID and commit ID you get in step2 to get a single commit:
For TFS 2015, the format looks like:
For VSTS, the format looks like: