Hi all,
I’m running into an issue with the tasks_api_instance.get_tasks_for_project
function in the Python Asana API (version 5.0.11). When I call this function, it sometimes returns the correct number of tasks, but other times it returns 0 tasks, even though I know there are tasks in the project. Here are some additional details:
- Authentication: I’m using a service account access token.
- Code: Here’s a snippet of the code that’s giving me trouble:
opts = {
'opt_fields': ",".join(fields),
'limit': 100,
}
for project in project_array:
tasks_array = list(tasks_api_instance.get_tasks_for_project(
project["gid"], opts=opts))
yield tasks_array
- Fields Requested: These are the fields I’m requesting for each task:
fields = (
"gid", "resource_type", "name", "approval_status", "assignee_status",
"created_at", "assignee", "start_on", "start_at", "due_on", "due_at",
"completed", "completed_at", "completed_by", "modified_at",
"dependencies", "dependents", "external", "notes", "num_subtasks",
"resource_subtype", "followers", "parent", "permalink_url", "tags",
"workspace", "custom_fields", "project", "memberships",
"memberships.project.name", "memberships.section.name",
)
I’ve looked at
- This post, but they’re using nodejs and resolved it by using the paid plan. We’re on Enterprise Legacy.
- This post, and it seems there’s a bug when asking for paginated results, but I’m getting issues with both paginated and unpaginated.
Has anyone encountered similar inconsistencies with this function? Could it be an issue with the way pagination is handled, or are there any known limitations with the service account token and accessing tasks across projects?
Thanks for any insights!