# Get tasks count overdue

**URL:** <https://forum.asana.com/t/get-tasks-count-overdue/161024>\
**Category:** API & Developers\
**Created:** [12 April 2022 11:09 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024 "2022-04-12T11:09:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon85153177](https://luna1.co/8d76cd.png) [@anon85153177](https://forum.asana.com/u/anon85153177)\
**Post date:** [12 April 2022 11:09 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/1 "2022-04-12T11:09:08Z")

</div>

Hi,

I am trying to get the overdue task count.

I see that

> `GET /projects/{project_gid}/task_counts`

reports the task count but the overdued ones

```auto
{
  "data": {
    "num_completed_milestones": 3,
    "num_completed_tasks": 150,
    "num_incomplete_milestones": 7,
    "num_incomplete_tasks": 50,
    "num_milestones": 10,
    "num_tasks": 200
  }
}

```

Is there a way to get the overdue task similar what is shown in the portfolio summary

 ![image](https://us1.discourse-cdn.com/asana/original/3X/3/d/3d3cc9e5e13bfccbd169a6b801ac49ec1cd99074.png)

Thank you.

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [12 April 2022 14:03 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/2 "2022-04-12T14:03:59Z")

</div>

@Bastien_Siebman I’m sure you’re doing this in Pulse; I guess it has to calculated manually by getting the actual tasks?

---

<div class="post-metadata">

**Author:** ![anon85153177](https://luna1.co/8d76cd.png) [@anon85153177](https://forum.asana.com/u/anon85153177)\
**Post date:** [12 April 2022 14:10 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/3 "2022-04-12T14:10:09Z")

</div>

Hi Phil, thank for your reply . I wanted to avoid for every project in my portfolio to retrieve all the tasks and for every task get the details in order to get the due\_date. These will be too many queries to `GET /tasks/{task_gid}`

For every project in portfolio  
For every task in project  
GET /tasks/{task\_gid}

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [12 April 2022 14:53 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/4 "2022-04-12T14:53:58Z")

</div>

I believe there is no way around querying all tasks. However if you use the search endpoint you can give several projects…

---

<div class="post-metadata">

**Author:** ![anon85153177](https://luna1.co/8d76cd.png) [@anon85153177](https://forum.asana.com/u/anon85153177)\
**Post date:** [13 April 2022 08:10 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/5 "2022-04-13T08:10:55Z")

</div>

Hi Bastien,

Thank you for the reply.

If I use the advanced search I can retrieve the overdue task but I need to perform an advanced search (resources consuming) for every project. If I enter several projects I don’t see the way to know what tasks belongs to what project.

For example, for 2 projects

> /tasks/search?projects.any=1202018361552925,1202092836384573&due\_on.before=2022-04-13&completed=false

```auto
{
    "data": [
        {
            "gid": "1202092836384582",
            "name": "Set final deadline",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384584",
            "name": "new task",
            "resource_type": "task"
        },
        {
            "gid": "1202093382152270",
            "name": "subtask1",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384589",
            "name": "Determine project goal",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384587",
            "name": "Milestone1",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384580",
            "name": "Schedule kickoff meeting",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384577",
            "name": "task 2",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384575",
            "name": "Milestone2",
            "resource_type": "task"
        },
        {
            "gid": "1202092836384568",
            "name": "task 2",
            "resource_type": "task"
        },
        {
            "gid": "1202048281732247",
            "name": "new task",
            "resource_type": "task"
        },
        {
            "gid": "1202048281732251",
            "name": "subtask1",
            "resource_type": "task"
        },
        {
            "gid": "1202018361552944",
            "name": "Set final deadline",
            "resource_type": "task"
        },
        {
            "gid": "1202018361552940",
            "name": "Determine project goal",
            "resource_type": "task"
        },
        {
            "gid": "1202018361552971",
            "name": "Milestone1",
            "resource_type": "task"
        },
        {
            "gid": "1202018361552942",
            "name": "Schedule kickoff meeting",
            "resource_type": "task"
        },
        {
            "gid": "1202018361552973",
            "name": "Milestone2",
            "resource_type": "task"
        }
    ]
}

```

So for me, the api

`GET /projects/{project_gid}/task_counts`

would be nice to return

`num_overdue_task`

It would reduce the number of API calls to get the same value and you can always avoid returning the field with opt\_fields.

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [13 April 2022 08:23 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/6 "2022-04-13T08:23:13Z")

</div>

When you run the search you should use `opt_fields` to ask Asana for specific fields, in that case the projects of the task. Let me know if that helps.

---

<div class="post-metadata">

**Author:** ![anon85153177](https://luna1.co/8d76cd.png) [@anon85153177](https://forum.asana.com/u/anon85153177)\
**Post date:** [13 April 2022 09:18 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/7 "2022-04-13T09:18:40Z")

</div>

Hi again Bastien,

As a leason learned from this topic [client.statusupdates.getStatus not working - #4 by Bastien\_Siebman](https://forum.asana.com/t/client-statusupdates-getstatus-not-working/160996/4)

you’re right, with opt\_fields I can ask for fields that normally does not appear.

Anyway, I still believe that including the field in the /task\_counts api would be more efficient in this particular scenario 🙂

Thank you.

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [13 April 2022 09:34 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/8 "2022-04-13T09:34:46Z")

</div>

I believe the Asana API team is a bit swamped so I would not expect this to be added anytime soon 😅

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:04 UTC](https://forum.asana.com/t/get-tasks-count-overdue/161024/9 "2025-05-30T19:04:22Z")

</div>

Closed on 30 May 2025 19:04 UTC


