Add subsection to status update via API

Hi,

when creating a status update via the UI you can add multiple sections to the update. This is useful because when doing so the section titles will be available as a “template” in the next status update. But I found no way to do this via the API, there you can only set one title thats then used. Is there a plan to add this to the API in the future? I tried creating multiple status updates via the API but then only the latest one is diplayed when creating a new status update in the UI.

Best regards,
Noah

4 Likes

I would love to see this! I’m working on a flow that updates project statuses with email and meeting hour statistics that are tracked outside of Asana. It would be great to automate sections for overdue, upcoming and recently completed tasks. Even just the ability to have section headers would be great.

Hi @Kyle_Gettemeier!

What the UI is doing is using an HTML template to make it easier for users to create sections. When you create a status update that has multiple sections and then retrieve the status with the API, it looks something like the following:

 {
    "gid": "1234567890123456",
    "html_text": "<body><strong>Section 1</strong>\nUpdate on section 1.\n\n<strong>Section 2</strong>\nUpdate on section 2.\n</body>",
    "title": "Status Update - July 3rd"
  }

To reproduce the same format using the API would be to use a similar html template in code for each section. Following is a mockup idea in JavaScript. It would produce functionally the same result as the UI.

// Retrieve latest sections from a database, file, or some other storage
const sections = [ {
	title: "Section 1",
	description: "Update on section 1."
}, {
	title: "Section 2",
	description: "Update on section 2."
} ];

// Build the body for the project status update
let htmlBody = "<body>";

for( const section of sections ) {
	htmlBody += `<strong>${ section.title }</strong>\n${ section.description }\n\n`;
}

htmlBody += "</body>";

// POST data to https://app.asana.com/api/1.0/status_updates

Hope this helps!

@David_Neal We are using the same approach as you mentioned, however there is one big difference from doing this via API vs doing it via the web UI.

If you create the status update via Web UI, Asana will “remember” all of your sections for the next status update. So for all following status updates you’ll have the same “structure”. Unfortunately this is not the case when posting this via API.

Of course a workaround is to post the initial status update as you described and for the following status update copy all the <strong></strong> parts manually. From there on it will work for all future updates, because it was created once directly via the Web UI. However, this is still a bit annoying and for us it would be great if this could be doable directly via API.