Hello all! Some of you may have noticed that Asana has recently added “vanity hyperlinks,” i.e., links that can have text that is different from the target, of the form
<a href="some location">different text</a>. We recently finished rolling out this feature to all users of the web app, and we can now announce that it’s available in the API as well. It works exactly as you’d expect: the API will no longer ignore the contents of
<a> tags when you write to any HTML text field, and you can populate the tags with any text you like.
Some notes about the integration with “automatic hyperlinks,” i.e., links that point to objects within Asana that had automatically-generated text:
- To disambiguate between “a link that Asana has automatically created a name for” and “a vanity link with a custom name” there’s a new attribute in our rich text:
<a data-asana-dynamic="true" ...>Title</a>means that “Title” is the canonical name of the object in Asana (the name of the task, project, user, etc.)
<a data-asana-dynamic="false" ...>Title</a>means that “Title” is a custom name that a user has given to the link
- If you want to create a vanity link to an Asana object, you must include
data-asana-dynamic="false"in the tag, or else the API will replace the contents of the tag with the canonical name of the object.