Mathias F
Mathias F

Reputation: 15891

Get the linked workitem in a release pipeline

I have set up a branch policy for the main branch that requires pull requests and linked workitems.

A build is configured as part of the branch policy.

Once the build for the merge is completed a release pipeline picks up the artifact. The release has "Pull request deployment" activated in the "Pre-deployment conditions"

In the release pipeline I need the information about the linked workitem. Is there a way to get it?

EDIT

At the end I could use the easy way and rely on the branch name that in our team conventions contains the pbi

The answer is still a good one. So I keep the question here

Upvotes: 1

Views: 1070

Answers (1)

Brenton
Brenton

Reputation: 444

I believe this is possible, though a little awkward. Steps would be as follows:

  1. Get the Build ID associated with the artifact using the Release.Artifacts.{alias}.BuildId variable
  2. Use the Get Build Work Items Refs API to get the list of work items linked to the PR build

Upvotes: 2

Related Questions