Is there a way to find the workitems for a release in Azure DevOps Api 5.1?

守給你的承諾、 提交于 2021-01-29 14:29:27

问题


I can find a release in Azure DevOps Api 5.1 by a request to https://vsrm.dev.azure.com/mycompany/myproject/_apis/release/releases/myreleaseid?api-version=5.1

How can I get the workitems of that release as shown on the devops portal under Deployment - Stages - Workitems?

My naive approach just using https://vsrm.dev.azure.com/mycompany/myproject/_apis/release/releases/myreleaseid/workitems?api-version=5.1

resulted in a 404.

There is a stakeholder in the workitem and I want to send him a notification adter the release.


回答1:


How can I get the workitems of that release as shown on the devops portal under Deployment - Stages - Workitems?

Hard to say, but I don't find any document about this topic... So I determine to use F12 to find that. And here's the one I finally find:

Get:https://vsrm.dev.azure.com/mycompany/myproject/_apis/Release/releases/myreleaseId/workitems?baseReleaseId={my baseReleaseId}&%24top=250&artifactAlias={my artifactAlias}

It will returns the IDs of the workItems for the release. Its response format:

After you get the IDs, it's easy to get details if you need using Get Work Items Batch or what.

In addition:

1.myreleaseId is the ReleaseID. (On my side, the ID is 7 if it's Release-7)

2.my artifactAlias is this:

3.For my baseReleaseId, I'm not 100% sure about its meaning. I think it could be something like ReleaseToCompareAgainst. Hint from Daniel. (On my side, if my releaseId=7, then I use basereleaseID=6(7-1), it works to get the correct WIT ids). (Actually I suggest you can use F12 in that web page to check your corresponding URL.)

And according to Mathias F: The baseReleaseId realy is the last previous release that has a deployment (-1 in some cases)

4.About how to use F12 to find rest api which may not be documented:

Hope all above helps :)



来源:https://stackoverflow.com/questions/61122347/is-there-a-way-to-find-the-workitems-for-a-release-in-azure-devops-api-5-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!