Tasks Filtered by Section and Modified_Since Not Working

Briefly describe (1-2 sentences) the Bug you’re experiencing:

Obtain the tasks that have been modified since a certain date-time. When filtering the gettasks by the project gid, it works fine. However, when doing so with the section gid, it seems that the modified_since parameter is not triggered and I obtain all tasks within the section regardless of their last modification date.

Steps to reproduce: get taks by section and modified_since parameters

Browser version: None - Python 3.11

Upload screenshots below: -

1 Like

Hi @JMBB,

I was able to reproduce this. Let me check with the team to confirm if this is a bug. In the mean time, if you are blocked by this, another endpoint that you can use to achieve this query is the GET /workspaces/{workspace_gid}/tasks/search (Search tasks in a workspace) endpoint [NOTE: In order to use this endpoint you will need to have a premium Asana account]

Here’s an example cURL:

curl --location 'https://app.asana.com/api/1.0/workspaces/<WORKSPACE_GID>/tasks/search?sections.any=<SECTION_GID>&modified_at.after=<ISO_8601_DATETIME_STRING>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <ASANA_PERSONAL_ACCESS_TOKEN>'
1 Like

Hi @John_Vu

I’m experiencing the same issue.
Search query is not a good replacement because pagination is not available.

is there ETA for fixing it?

Thanks

Hi @anon77486349, sorry to hear that this is affecting you and that the workaround isn’t great due to the lack of pagination. The API team is actively working on this bug. I don’t have a firm date, but I would estimate it will be fixed in the next few weeks.

1 Like

Hi @JMBB and & @anon77486349,

Our API team has implemented a fix for this bug and it should be working now. Let us know if you encounter any issues.

1 Like

Can you also fix the “completed_since” parameter?

I wish we could retrieve tasks by section from that endpoint, using the “completed_since=” parameter, like we can for projects.

That bug is there since 2019, and should have been fixed also, as we can read on these threads

There once was documentation about it, but it had disappeared.

2 Likes

Hi @Frederic_Malenfant,

Based on the last message from Joe_Trello on this thread it didn’t seem possible at the time to do this kind of advance filtering with our Get multiple tasks endpoint. I’ll check in with our API team to see if we can get this fixed now.

1 Like

Hi @Frederic_Malenfant,

I talked with our API team and we think that there might be some confusion with how completed_since works.

The completed_since query param can be a bit confusing because it includes both completed and incomplete tasks. It should really be called something like incomplete_and_completed_since because using this query param will return tasks that are completed and incompleted since the specified date-time.

Example Scenario:
Let’s say you have a project with Section 1 (GID: 123)

Section 1:

  • Task 1 [COMPLETED - 06/14/2023]
  • Task 2 [INCOMPLETE]
  • Task 3 [COMPLETED - 06/14/2023]

Let’s say your request look like:
/tasks?section=123&completed_since=2023-06-17T00:00:00.000Z

This will return something like:

{
    "data": [
        {
            "gid": "789",
            "name": "Task 2",
            "resource_type": "task",
            "resource_subtype": "default_task"
        }
    ]
}

Let’s say you modify your request to:
/tasks?section=123&completed_since=2023-06-13T00:00:00.000Z

This will return:

{
    "data": [
        {
            "gid": "456",
            "name": "Task 1",
            "resource_type": "task",
            "resource_subtype": "default_task"
        },
        {
            "gid": "789",
            "name": "Task 2",
            "resource_type": "task",
            "resource_subtype": "default_task"
        },
        {
            "gid": "101112",
            "name": "Task 3",
            "resource_type": "task",
            "resource_subtype": "default_task"
        }
    ]
}

Notice that in this second request we set the date to 2023-06-13T00:00:00.000Z which captures tasks (completed and incompleted) since/after 2023-06-13T00:00:00.000Z within Section 123.

If you would still like to use this particular endpoint (Get multiple tasks) to get incompleted tasks since <YOUR_DATE_TIME> then you could ask for the (i.e. completed property) in the opt_fields and do client side filtering after you received the response.

Thank you @John_Vu , I just tried it, and now it seems to work as expected, in projects AND sections.

That’s what we use in Bridge24,
to get “incomplete” tasks, we use ?completed_since=now.
And, to get all, we use ?completed_since=1900-01-01. (or no parameter)

That was working for /projects/xxx/tasks, but not for /sections/yyy/tasks".
But, I just tried that again, using /sections endpoint, and it seems to work fine now!
I am sure something have been fixed since, because it was not working yet a few weeks ago.

Thank you!

Hi @Frederic_Malenfant,

That’s good to hear. Glad that this works for you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.