How to extract task predecessor dependency via API?
Hi all,
We're working on a piece of software that is supposed to retrieve an object and some of its structure from Workfront using the API, and then create/copy this same structure on a different domain using more API calls.
We are having trouble recreating the exact hierarchy of tasks with predecessors. A more concrete example:
A project has two tasks: Task 1 and Task 2, where Task 1 is the predecessor of Task 2.
In the API explorer the task object has 'predecessors' and 'successors' under the collection tab.
However when querying the API using these fields, the information is not as expected.
Query to API:
https://domain.my.workfront.com/attask/api/v14.0/task/search?fields=predecessors,successors
Query result task 1:
Info from query task 1: {'ID': '123xxxxx', 'name': 'Task 1', 'objCode': 'TASK', 'predecessors': [], 'successors': [{'objCode': 'PRED'}]}
..and query result task 2: {'ID': '123xxxxx', 'name': 'Task 2', 'objCode': 'TASK', 'predecessors': [{'objCode': 'PRED'}], 'successors': []}
As we can see, the predecessors (and successors) field has no ID or any other indication what it's predecessor or successor is.
This makes it hard to figure out which tasks to link together in terms of predecessor and successor.
As far as we can see there are no other fields for Task that give us the needed information.
Maybe we're overlooking some important field or the way we query is incorrect?
Any help in how we could fix this would be greatly appreciated!