# How to use the Task Count Endpoint for Projects in the java client library

**URL:** <https://forum.asana.com/t/how-to-use-the-task-count-endpoint-for-projects-in-the-java-client-library/99471>\
**Category:** API & Developers\
**Tags:** client-libraries, tasks\
**Created:** [6 November 2020 14:33 UTC](https://forum.asana.com/t/how-to-use-the-task-count-endpoint-for-projects-in-the-java-client-library/99471 "2020-11-06T14:33:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Ross\_Grambo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ross_grambo/32/68568_2.png) [@Ross\_Grambo](https://forum.asana.com/u/Ross_Grambo)\
**Post date:** [1 December 2020 00:32 UTC](https://forum.asana.com/t/how-to-use-the-task-count-endpoint-for-projects-in-the-java-client-library/99471/6 "2020-12-01T00:32:48Z")

</div>

> [@Ronald\_Findling](#):
>
> ```auto
> client.projects.getTaskCountsForProject(projectId).option("fields", "num_tasks").execute()
> 
> ```

If you change it from `.option` to `.query` it will work as expected.

I’m not sure why option isn’t working here…

---

_[View the full topic](https://forum.asana.com/t/how-to-use-the-task-count-endpoint-for-projects-in-the-java-client-library/99471)._
