0

Am using PHP class (https://github.com/ajimix/asana-api-php-class) to fetch asana task through its API.

I want to fetch task created by specific user (am not talking about assignee here because my assignee gets change).

Currently, my approach is: get all task, get details of each task by looping and get its creator name and then filter through code, but this is taking hell lot of time to get complete as i have thousands of tasks.

Can you suggest for any easy way?

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Zeeshan
  • 165
  • 1
  • 13
  • Add your code and benchmark ("hell lot of time" is vague). Also, add the relevant database queries and information on the tables (especially, what indexes are on the tables). Optimal would be to also add the time the queries take by themselves. – Risadinha Sep 29 '15 at 11:37
  • This is straight forward PHP code, no database used. I have a project created on asana where am getting all tasks from it and looping through the details of each task, filtering through some tags and checking for the creator. In loop - 1) get task having certain tasks. 2) check if creator name is same as required. 3) store those id's in an array. For bench marking : i have 5800 tasks which took 5h 26m 54s to complete above process. – Zeeshan Sep 29 '15 at 13:21
  • Sorry typing mistake.... In loop - 1) get task having certain tags (not tasks) – Zeeshan Sep 29 '15 at 13:48

1 Answers1

0

Have you considered using the official asana PHP client?

Unfortunately, you cannot filter task queries by task creator.

Some general pieces of advice for increased query efficiency:

  • Pagination - by using pagination each request will return faster.
  • Threading - use a separate threads to make requests to the Asana API and to process the data returned

I have noted the request for this additional query parameter for /tasks

Andrew Noonan
  • 848
  • 6
  • 13
  • Thanks Andrew for the comment. I am using pagination now. Actually my goal was to get all task created by specific user in specific month. So am just passing month and user name which should fetch me those task. Currently with pagination (100 task/per page) am getting task. Assuming the tasks list which are coming are sorted with creation date. so am getting (82, 20, 3, 0, 0 , 0) task per page for that specific month. I restricted fetching query if zeroes are more than two assuming there will be no task in next pages for the specified month..Hope so this the case and am doing it right. – Zeeshan Oct 02 '15 at 06:24
  • @Zeeshan yes, you can assume that when the page contains 0 entries that there are no more pages to read. – Andrew Noonan Oct 05 '15 at 17:16