-
Notifications
You must be signed in to change notification settings - Fork 50
Description
When using the getWorkItemRelations() method, if the user is currently on an org level page, like the Organization Search page, it returns the following error:
Uncaught (in promise) {stack: 'TypeError: Cannot read properties of undefined (re….min.js:1:7948\n at async Promise.all (index 0)', message: "Cannot read properties of undefined (reading 'id')"
I am calling getWorkItemRelations() in a custom Work Item Control extension. And the issue happens when the work item/extension loads after selecting one of the work items from the search results. Example URL where the issue occurs: https://dev.azure.com/<org>/_search?text=123456&type=workitem
If i navigate to the work item within the actual team project, the getWorkItemRelations() call succeeds as it should.
Example code of how the method is being called"
const workItemFormService = await SDK.getService<IWorkItemFormService>(WorkItemTrackingServiceIds.WorkItemFormService);
getWorkItemRelationships = await workItemFormService.getWorkItemRelations();