Mathias F
Mathias F

Reputation: 15891

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

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.

Upvotes: 0

Views: 930

Answers (1)

LoLance
LoLance

Reputation: 28086

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:

enter image description here

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:

enter image description here

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:

enter image description here

Hope all above helps :)

Upvotes: 1

Related Questions