API for milestones?

Regarding Announcing milestones!:

Is there any timeline for when the ability to create milestones will be available in the API? I can see the type is reported in the resource_subtype field of the task, but it is read only. Is a new endpoint planned to modify this?

Thanks,
Mike.

1 Like

Hi @Kothar, now that milestones have officially launched, we will allow changing the resource subtype of tasks in the API. It won’t be done through a new endpoint, but rather through the existing PUT /tasks/<task-id> endpoint. I’ll update this thread once we’ve enabled writing to the resource_subtype field.

3 Likes

Fantastic, thanks Joe!

1 Like

This is now available in the public API, and you can write to resource_subtype to change between "default_task" and "milestone". (Because of the upcoming sections deprecation we are not allowing clients to set this field to "section".)

2 Likes

I am getting an error:

“errors”: [
{
“message”: “projects: Cannot write this property”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: Errors”
}

In another occasion I was able to write resource_subtype to change between "default_task" and "milestone"

Hi @anon6081685,

Are you getting this when trying to create a new task, or modify an existing task?

Hey @Phil_Seeman

modify an existing task

@Phil_Seeman it’s an inconsistent error

Darn. I know there’s a bug that can occur with setting a milestone on a new task, but it doesn’t apply to changing an existing one.

Are these tasks all in the same workspace/org or in different ones? Are they all attached to a project or are they sometimes not attached to any project? Are they all top-level tasks or sometimes a subtask?

Same workspace/org, about 800+ projects. These milestones are all top-level tasks.

The easiest thing for me would be to run the script again if you guys fix the bug on your end.

Otherwise i have to delete the task and create a new one in it’s place. And for 800 projects it takes 13 hours to run.

Sorry I missed that - can you say a bit more about that? It works 99% of the time, 50%, etc? If you’re saying it works sometimes and not other times, that’s a whole different situation than it just not working at all.

Just to be clear, I don’t work for Asana; I’m just a volunteer and fellow developer. :slight_smile: