Getting all tasks from subfolders using the API

Hello! 
I am trying to create an API call which will return all the tasks from all the subfolders of specific folder.

The way I am doing it now, it's getting all the children of the first folder
then iterating over every folder in the children list and getting the tasks inside it.

unfortunately - it's working very slow.

someone knows how can I get tasks from subfolder using the API ? is there such option ?

 

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
7 comments
Avatar
Hugh

Hi Mher Tolpin, welcome to the Community! I just raised a Support ticket for you, someone should be in contact with you soon.

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Hi,

I am facing same issue. Is there any solution to this?

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
Avatar
Cansu

Hello Esko Viranko, welcome to the Community 👋🏻
 
Have you checked our page for Wrike developers?
 
We have a section on Query Tasks here that can help with providing a solution.
 
I can direct you to our API experts if you need more details, please let me know 🙋🏻‍♀️
0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Is there any solution to this issue? I am also facing a similar issue. Thanks. 

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Hi Tyler Sheffield! Here's the previous response by our Support team API experts:

If you need to find all tasks related to a particular folder or a project, you can query the tasks in that folder and its subfolders:

[GET] https://www.wrike.com/api/v4/folders/{folderId}/tasks?descendants=true

This approach ("asking parents to tell us all about their children") is more straightforward than tracing family connections from children to their parents. 

But if you need to trace which folder/project a given task is related to, you can query task details (https://developers.wrike.com/api/v4/tasks/#query-tasks):

[GET]  https://www.wrike.com/api/v4//tasks/{taskId}

and look at the parentIds and superparentIds returned. Normally, the IDs of the parent folders or projects can be found in the parentIds. However, some tasks may not be directly included in any folder/project. For such tagless tasks, the virtual ‘Root Folder’ will be returned as their parent, but they will also have non-null superparent(s). Thus, if you see "rootFolderId" returned as parentId for some tasks, you should use superparentIds to find the folder(s)/project(s) these tasks are related to.

Could you try these options and let me know if that worked? 

Lisa Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Lisa Wrike Team member Become a Wrike expert with Wrike Discover

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

The one issue I have found with using "descendants=true" is that is will not return tasks that are sub-items of a task within the parent folder. It will get all the tasks from sub-folders, but can't return tasks that are sub-items of another task. 

Any idea how I could solve this issue?

Thanks!

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Tyler Sheffield I've asked our API experts to look into this for you - they will reach out to you 👍

Lisa Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Lisa Wrike Team member Become a Wrike expert with Wrike Discover

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Folllowing List for Post: Getting all tasks from subfolders using the API
[this list is visible for admins and agents only]

Top
Didn’t find what you were looking for? Write new post