get_tasks_for_project not returning all tasks

Hi! I’ve been running the same line of code for the past two years or so:

tasks = client.tasks.get_tasks_for_project(gid,{‘is_subtask’:False,‘opt_fields’ : [‘’, ‘custom_fields.display_value’,‘completed’, ‘name’, ‘permalink_url’, ‘created_at’,‘’, ‘’ ]})

and it had always worked fine until a couple of weeks ago. It is now not consistently pulling all tasks. I’m not getting an error, but in later code I compare what’s currently in my Asana project to a csv file based on a unique ID field. Lately, I’ve been getting lots of tasks in the csv that don’t match an existing Asana task (even though they do in reality) and have traced the issue back to the get tasks API call not pulling these tasks down in the first place. It doesn’t happen every time, and usually if I try again later in the day, it runs no problem. That said, I’m hoping to schedule my scripts v. running them manually, which poses a problem if I’m not there to catch it. It seemed to start around the time of the last update where I noticed other loading issues (like taking my website version a long time to load in certain columns).

Not sure if this is related, but the past two days I’ve gotten this error when trying to create new tasks:

result = client.custom_fields.create_enum_option_for_custom_field(gid, {‘color’: ‘blue’, ‘name’: str(value)}, opt_pretty=True)
(‘Rate Limit Enforced: You have made too many requests recently. Please, be chill.’,)

This was only the 6th API call made, and my code went on to run hundreds of API calls without issue when updating existing tasks over the following couple minutes. It’s only happening when attempting to create new tasks.

Does anyone know if the latest update is somehow limiting the number of tasks getting pulled from get_tasks_for_project?


I don’t know about your issue exactly.

But one thing looks strange to me.

You are using “is_subtask”: false.

That is not supported in function [get_tasks_for_project].

It is only available in [search_tasks_for_workspace].