问题
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 behtml_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
andhtml_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