microsoft / featuretimeline

VSTS extension for managing and planning features
https://marketplace.visualstudio.com/items?itemName=ms-devlabs.workitem-feature-timeline-extension#overview
MIT License
88 stars 45 forks source link

Epic roadmap error when lastEpicSelected is a deleted epic #274

Closed kw80 closed 2 years ago

kw80 commented 4 years ago

STEPS TO REPRODUCE

EXPECTED RESULT The Epic Roadmap is properly displayed

ACTUAL RESULT Error message "Expecting constant value. The error is caused by «)»."

ROOT CAUSE In Web Developer tools, there is a PUT request to https://server/collection/_apis/ExtensionManagement/InstalledExtensions/ms-devlabs/workitem-feature-timeline-extension/Data/Scopes/User/Me/Collections/%24settings/Documents which returns current user settings for this extension, including ""lastEpicSelected" A bit further, the following POST request is executed: https://server/collection/ab12cd34-e56c-43bc-ab00-550528b455f9/_apis/wit/wiql?%24top=19999 Including payload SELECT [System.Id] FROM WorkItemLinks WHERE (Source.[System.Id] IN(356140) )... Id 356140 is the value of "lastEpicSelected". Azure Devops cannot find the work item and an error is thrown

FIX Verify if lastSelectedEpic work item exists. If not, consider it blank and display the Epic Roadmap as if no epic was selected before.

WORKAROUND Restore the removed epic from the recycle bin if exists. If not, change the lastEpicSelected value via API call for the current user into an existing epic: $payload = "{""id"":""EpicRoadmapa1234567-8a9b-4e47-a828-74304556200e_settings"",""value"":""{\""showWorkItemDetails\"":false,\""progressTrackingCriteria\"":0,\""showClosedSinceDays\"":0,\""lastEpicSelected\"":457029,\""dismissedPortfolioPlansBanner\"":false}"",""__etag"":-1}" Invoke-RestMethod -Uri "https://server/collection/_apis/ExtensionManagement/InstalledExtensions/ms-devlabs/workitem-feature-timeline-extension/Data/Scopes/User/Me/Collections/%24settings/Documents?api-version=3.1-preview.1" -UseDefaultCredentials -Method Put -Body $payload -ContentType "application/json"

danhellem commented 2 years ago

Sorry, but this code in this repo is not currently being maintained. We recommend you use the Delivery Plans feature that is core to Azure DevOps.