How to extract task predecessor dependency via API? | Adobe Higher Education
Skip to main content
December 9, 2021
Besvarat

How to extract task predecessor dependency via API?

  • December 9, 2021
  • 1 svar
  • 1130 visningar

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!

Det här ämnet har stängts för svar.
Bästa svar av Richard_Le_

Hi Carlos,

To retrieve all the nested fields under the predecessors and successors collections, you need to append a colon and asterix to the collection reference. So your api call would look like this:

https://domain.my.workfront.com/attask/api/v14.0/task/search?fields=predecessors:*,successors:*

Alternatively you could add the specific nested field your want to retrieve, again using colon syntax:

https://domain.my.workfront.com/attask/api/v14.0/task/search?fields=predecessors:predecessorID,successors:successorID

Best Regards,

Rich.

1 svar

Community Advisor
December 9, 2021

Hi Carlos,

To retrieve all the nested fields under the predecessors and successors collections, you need to append a colon and asterix to the collection reference. So your api call would look like this:

https://domain.my.workfront.com/attask/api/v14.0/task/search?fields=predecessors:*,successors:*

Alternatively you could add the specific nested field your want to retrieve, again using colon syntax:

https://domain.my.workfront.com/attask/api/v14.0/task/search?fields=predecessors:predecessorID,successors:successorID

Best Regards,

Rich.

CarlosFl1Skribent
December 10, 2021

Hi @Richard Leek‚ ,

Thanks a lot for your help! Much appreciated.

Already working on it with our team. Keep you posted on it! 😉

Regards,

Carlos