Not Getting Subtasks Immediately After Duplication of a Task Via API

I’m trying to get all Subtasks from a Task which I’ve created by duplicating a task. Basically Immediately after duplication of the task if I make a request to the following path, I get 200 Response but with empty array… No data about subtasks!.. If I wait for a while and then make another request then I get all subtasks. what is the issue here.

https://app.asana.com/api/1.0/tasks/{task_gid}/subtasks

in the {task_gid} field I used my newly created task id :slightly_smiling_face:

Hi @Sajal_Sarkar,

After you initiate the duplication, are you grabbing the job_id from the response and then using it to repeatedly call the GET /jobs/{job_gid} endpoint until it tells you the job is finished? You’ll want to insure that the duplication job is finished before trying to query for objects being created by the job.

2 Likes

It worked :+1: Thanks @Phil_Seeman :slightly_smiling_face:

1 Like

Awesome!