Forum Discussion

kvadagama's avatar
kvadagama
Copper Contributor
Jul 25, 2023

Azure work items related API is not returning Linked PR/Commit related detail.

I have created a couple of WorkItems

- I have linked Github Pull request and one commit with the first work Item.

- I have linked Azure Repo's Pull request and one commit with the second work Item.

 

I hit API to get workitems

https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{workitem_id}?$expand=relations&api-version=7.0

 

I am getting related(linked) Pull request(Pr No)/commit(only commit sha) as following. But I am not getting any clue like which is project/repository of this Pull request/commit. 

Is there any way to get these detail of Pull request or commit?

 

Note: Same is happening for even Azure Repos' commit/PullRequest

 

 

"relations": [
        {
            "rel": "ArtifactLink",
            "url": "vstfs:///GitHub/PullRequest/444bd22d-cd27-488f-b15b-5c64769b8141%2F4",
            "attributes": {
                "authorizedDate": "2023-07-17T11:48:10.67Z",
                "id": 7043556,
                "resourceCreatedDate": "2023-07-17T11:48:10.67Z",
                "resourceModifiedDate": "2023-07-17T11:48:10.67Z",
                "revisedDate": "9999-01-01T00:00:00Z",
                "name": "GitHub Pull Request"
            }
        },
        {
            "rel": "ArtifactLink",
            "url": "vstfs:///GitHub/Commit/444bd22d-cd27-488f-b15b-5c64769b8141%2F187992c8baefab1c1495a4ae6f9fbb3ccc7680c0",
            "attributes": {
                "authorizedDate": "2023-07-17T11:48:10.67Z",
                "id": 7043555,
                "resourceCreatedDate": "2023-07-17T11:48:10.67Z",
                "resourceModifiedDate": "2023-07-17T11:48:10.67Z",
                "revisedDate": "9999-01-01T00:00:00Z",
                "name": "GitHub Commit"
            }
        }
    ]

 

 

 

1 Reply