dsgk40568 2013-05-10 10:54
浏览 58
已采纳

在Asana中获得已完成任务与总任务的比率

I'm creating a panel for Panic's StatusBoard to show projects from my workspace, with the ratio of completed tasks to total tasks.

I can do this currently, based on what I'm seeing in the API Docs, the problem is I need to make about 40 requests to get all the info I need and this number will only get larger as more tasks are added to my selected projects.

I'm looping through each selected project and getting each individual task, but all I'm taking from that task object in the 'completed' property.

Is there a way to get each project with completed counts and total counts as properties?

Or, is there another approach that I could take so that I don't get timeout errors when making so many requests..

  • 写回答

2条回答 默认 最新

  • dongmei2351 2013-05-10 19:13
    关注

    You should be able to do this by getting all of the tasks for a project and selecting the completed field using the ?opt_fields=completed option on your request.

    E.g., http://app.asana.com/api/1.0/projects/[project]/tasks?opt_fields=completed

    where [project] is the project ID you're querying. This will return the completed status of all tasks within a given project. You would then iterate over the returned tasks and count the completed/uncompleted statuses.

    Note that with the opt_fields option, only the identified fields will be returned.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?