根据https://asana.com/developers/api-reference/stories上的文档,我应该能够为任务或项目创建故事。
POST /tasks/task-id/stories
POST /projects/project-id/stories
但是,我没有运气将故事添加到项目中。错误消息非常简单,“无法评论此对象”。似乎也没有办法在 Web UI 中执行此操作。这是否仅仅意味着 API 文档不正确?
将故事添加到任务 - 作品
curl -u $ASANA_API_KEY: https://app.asana.com/api/1.0/tasks/4646321361313/stories -d "text=This is a comment"
--- RESPONSE ---
{"data":{"id":4646330012437,"created_at":"2013-03-22T20:23:45.645Z","source":"api","type":"comment","text":"This is a comment","created_by":{"id":1071358442997,"name":"Chris LoPresto"},"target":{"id":4646321361313,"name":"Here is a task"}}}
将故事添加到项目 - 不起作用
curl -u $ASANA_API_KEY: https://app.asana.com/api/1.0/projects/4646342124006/stories -d "text=This is a comment"
--- RESPONSE ---
{"errors":[{"message":"target: Cannot comment on this object"}]}