How to Set Rich Text in Asana Project Description via API

允我心安 提交于 2019-12-12 23:52:08

问题


Is there a way to include rich text when setting the project description via the API? I can set the description via the notes attribute, but any HTML renders as plain text. I have also tried using html_text.

Sample request:

{
"data": {
    "name": "Test project",
    "notes": "<strong>Sample project description</strong>",
    "html_text": "<strong>Sample project description</strong>",
    "team": <team_number>,
    "workspace": <workspace_id>
    }
}

回答1:


In principle, you're on the right track. However, there are a couple issues:

  • The description of the project is notes (see https://asana.com/developers/api-reference/projects), so the rich text field would be html_notes.
  • Projects don't currently support html_notes in the API. Though that's likely to change in future, I'm afraid I can't really guess at when that's likely to happen - there's a lot on our roadmap.
  • html_text and html_notes are not officially supported fields yet, and the behavior of them is likely to change. If you want to take advantage right now, be aware that it's very finicky about the format of the HTML.


来源:https://stackoverflow.com/questions/26962213/how-to-set-rich-text-in-asana-project-description-via-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!