A new API for Project Templates

Hi @Tony_Anh_Nguyen,

No, not currently. Asana will likely be adding CRUD capability to the new Project Templates 2.0 but it’s not there now.

(cc: @Kem_Ozbek, here’s another vote for CRUD in PT 2.0)

Hi @Phil_Seeman,

Any chance we know when that might be added?

No, sorry, @Tony_Anh_Nguyen, I don’t have any info on timing.

Hi everyone! I began the work to migrate my application to the new endpoints, but quickly ran into a roadblock because the latest versions of the Asana Node.js SDK are not being published to npm. Could you all reach out to the maintainers of the Node.js SDK internally to get this fixed up?

The latest release on GitHub is v0.18.3 (released on March 4, 2022) which adds support for the project templates API, but the latest release pushed to npm is v0.18.6 (released on Feb 26, 2021).

I’m bringing it up here because there is a GitHub issue for this, but it hasn’t seen any activity from the maintainers.

I looked through the commit log and I think they deploys broke because Travis CI stopped running jobs on travis-ci.org. If that is indeed the reason, it should be a pretty easy fix to move the repository over to travis-ci.com and re-run the build. Happy to help with that process if needed :smiley:

It is probably too late but templates v2 do not seem ready for our clients and us. They are lacking some features like multi-select of tasks, define default sort or filter, define/edit dashboard… am I missing something or did all of this will disappear slowly with no fix in sight?

Has someone compiled a list of features that will disappear? Otherwise I will.

cc @Phil_Seeman

I don’t know of a comprehensive list in one post. There is a bunch of discussion about missing features here: Say Hello to Project Templates 2.0!

That thread is probably the best place for further discussion on PT 2.0, and for such a list.

I believe this update is affecting my Asana for Salesforce integration. The Asana for Salesforce app is no longer recognizing any of my custom templates that I have created in Asana, and therefore will not let me automatically create a project in Asana when an Opportunity is initiated in Salesforce (which is like the biggest feature of the integration).

Is anyone else having this issue? Anyone with a solution?

@Abby_Watson1,

I don’t have any first-hand experience with the Salesforce integration, but I know when Asana released PT 2.0, they said the Salesforce integration had been updated to handle the new templates. So I’d recommend using the #bugs:report forum area to file a bug report on this.

Thanks Phil! Asana support requested yesterday that I uninstall and reinstall the integration using a new link they sent me via email. Unfortunately, the link they sent me was for the same version of the integration that I was already using, and so the problem persisted.

I will take your advise and also post this issue in the #bugs:report forum.

Hopefully will have a solution soon!

1 Like

I’m am trying to create a new project from a template in Asana using the API. I am consistently getting a error relating to the ‘requested date’ field.

Any thoughts on what I am doing wrong?

You are passing a field without a value, instead of emptying the field in Postman, untick the box in front of the field :slight_smile: That should do the trick.

Thankyou for your fast response Bastien, Unticking the box does not seem to make a difference here. The only way I can get the API to execute successfully is to remove the due dates in the project template.

Here is a screen recording of me demonstrating that the API works when the due dates are removed from the project template. When the dates are in the project template the API fails.
https://vimeo.com/731621655

If you have dates in the template, then you need to give either a start date or an end date. That’s why the call is failing. requested_dates is probably compulsory.

1 Like

Your body should be json and not form data. (select raw and then JSON)

Example body:

{
“name”: “test project”,
“team”: “1200303191xxxxx”,
“public”: false,
“requested_dates”: [
{
“gid”: “1”,
“value”: “2022-08-01”
}
]
}

if this is still not working, try to get the project template to find out which “gid” is used.

1 Like

Given the error he had, I think is body is correct, the value for the field is just missing and compulsory?

Is anyone finding an issue when using python? I keep getting “errorMessage”: “‘Client’ object has no attribute ‘project_templates’”.

It is possible that the python library was not updated to work with the latest API endpoint! Did you check the history of updates for the library on GitHub?

When that is the case with the node library, they allow you to use the dispatcher to call custom endpoints, I can share the code if needed.

Hi @Sam_Lintern,

@Bastien_Siebman is on the right track here, but you can’t just omit requested_dates, you need to pass it. That is, if any of your template’s tasks have relative dates set on them, as yours do, then when creating a project from the template, you need to tell Asana what date you want to use as the “anchor” date from which it should calculate all of the relative task dates. Send that “anchor” date in the requested_dates property as shown here in the API docs. Note that the gid property can be any GUID of your choosing; it doesn’t correspond to any existing object but rather it just provides a unique value to go along with the anchor date you pass.

Having said that, if you don’t want to provide your own “anchor” date but just want Asana to calculate all of its task dates from an “anchor” date of today (that is, whatever the current date is that you’re creating the project), then instead of sending the requested_dates property, omit it and send a property of is_strict set to a value of false. As shown in the docs, this will not generate an error but will use a default value of today as the anchor date.

I haven’t checked the history of updates for the library on GitHub, calling the custom endpoints would be fantastic if you could please share. Thanks!