Use REST API
http://{collection}/{project}/_apis/build/builds/{buildid}/workitems?api-version=5.1
to get the linked work items of the following 2 build
create branch which linked work items -> pull request -> merge -> build -> saw linked changes and work items in build summary -> use the REST API to get work items list
create branch -> pull request which linked work items -> merge -> build -> saw linked changes and work items in build summary -> use the REST API to get work items list

What I've seen:
- The url response of Build 1 has shown the expected work item list
- The url response of Build 2 has shown count is 0

What I want to know:
- Why did The the REST API response differently for the above 2 builds?
- Do I do something wrong with the api?
ENV: azure devops Dev17.M153.5