Vanity links are now in the API

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: data-asana-dynamic
    • <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.

Enjoy!

7 Likes

Thanks for the update @Joe_Trollo! Are you able to pass on this related behavior for me?

Automatic hyperlinks that are included in the description of a task via a CSV import do not recognize the automatically-generated text of the Asana item when viewing from mobile

In order for the automatically-generated text to show on mobile, you have to re-link the Asana item from the web. Essentially recreate the automatic hyperlink from the web instance. When viewing from the web, the automatically-generated text appears. It just don’t convert via mobile unfortunately.

Thanks!!!

This appears not to work on custom fields, is that correct?
I’m trying to find a way to make a link in a custom field display different text than it’s URL.
The API response differentiates between “text_value” and “display_value” on custom field links but the values are always identical.

Hi @anon91858240 and welcome to the forum,

That’s correct, it does not. Custom fields don’t support true HTML like the task html_notes, for example, does.

Disappointing, but thanks for the confirmation!