Get Predecessors of a Task along with its Start - Id and End - Id using a single request
-
08-02-2021 - |
Question
My requirement is to fetch all the task links of a Project with Start - Id and End - Id of every task link.
Currently I am only able to fetch LinkId
, ProjUid
, Lag and Dependency type using REST API:
https://contoso.sharepoint.com/sites/pwa/_api/ProjectServer/Projects('ProjectGUID')/TaskLinks
Then to Get Start - Id and End - Id, I have to again send two additional API requests and it takes a lot of time when I have to fetch a total of 8000+ Task Links in a project with 8500 tasks.
Solution
I don't think you can get Predecessors for all tasks in a single request, you can only get predecessor for a specific task
/Tasks('<TaskGUID>')/Predecessors
Additionally, you can also use ProjectData
to get all tasks with specific fields
https://contoso.sharepoint.com/sites/pwa/_api/ProjectData/Projects(guid'{project guid}')/Tasks()?$Select=TaskName,TaskId
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange