-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
CoreClient getProcessByID fails regularly, maybe 1/10. Appears to be some async issue either in the extension api library or backend.
/**
* Get the current process for a given projectId.
*
* @param coreClient Client for accessing core data.
* @param projectId Project ID.
* @returns Current process.
*/
export const getCurrentProcess = async (coreClient: CoreRestClient, projectId: string) => {
try {
console.log('Getting current process for project:', projectId)
const projectProperties = await coreClient.getProjectProperties(projectId)
console.log('Project properties:', projectProperties)
try {
const currentProcessTemplate = projectProperties.find(
(prop) => prop.name === 'System.CurrentProcessTemplateId'
)
console.log('Current process template:', currentProcessTemplate)
const currentProcessTemplateId = currentProcessTemplate?.value
const currentProcess = await coreClient.getProcessById(currentProcessTemplateId)
return currentProcess
} catch (error1) {
console.error('Error getProcessById:', error1)
throw error1
}
} catch (error2) {
console.error('Error getProjectProperties:', error2)
throw error2
}
}
This is "azure-devops-extension-api": "^4.235.0",
Metadata
Metadata
Assignees
Labels
No labels