Duplicate Custom Project Template with Zapier

Currently there is no Zap to duplicate a pre made Asana project template. This is very frustrating as it requires manually duplicating the required project template within the workflow.

Other task management platforms have this capability within Zapier, could we get it? :slight_smile:

3 Likes

Hi @Waira_Mendoza_Angle and thanks for talking the time to share your feedback with us today. I donā€™t believe this is in our near-term plans, but Iā€™ll keep you posted on this thread as soon as I have some updates on my end!

This is something we absolutely need as well. We create hundreds of projects using templates and would love to be able to trigger this with other apps.

1 Like

Totally agree! This is desperately needed!

Hi @Billy_Rickman and welcome to the forum!

This is actually easy to do now with my Flowsana integration - see the Auto-create a new project from a template section of this forum post:

Basically what you would do is use Zapier to trigger any of the Flowsana rule conditions - creating a new task, or adding a particular tag to a task, for example - and then that rule condition will trigger the Auto-create a new project from a template rule action.

Hi All,

I need to have more than one form/template for the different projects/sections. Does anyone know if this is possible? For what I can see we can just have one Form within Asana.

With Flowsana is not possible either.

Thanks!

Asana currently doesnā€™t support more than one form per project. You can vote for an enhancement to allow multiple forms in a project here:

If I could do it in Flowsana (Iā€™m the author), I would, but Asanaā€™s programming interface doesnā€™t provide the means to get past the one-form-per-project limitation.

Thanks a lot Phil! And congrats for Flowsana! :clap:

1 Like

Agreed! Having the ability for Zapier to duplicate an existing Asana project would be amazing!

To our business, Asanaā€™s value is derived from our ability to replicate projects that replicate actions consistently and without mistakes. We donā€™t need to ā€œre-invent the wheelā€ each time.

Thanks!

We absolutely need this!!! We are using Zapier-> Asana to create projects and canā€™t use Asana unless templates are created automatically.

As far as I can tell there is nothing special about the template other than that it shows as option when creating a new project. Using the duplicate project API is more or less the same thing.

Therefore you can just use the ASANA api for duplicating a project (use the project Id of the template). We just write some basic code in Code by Zapier using input data from our trigger. Instead of choosing ASANA action choose Code by Zapier and write an API command in JavaScript or Python.

2 Likes

hey Michael would you be willing to share the custom code you have to duplicate a project in Zapier?

Sure. Note that you will need to add info where it says ā€˜yourā€™. And the input_data is from the input data fields we created.

id=ā€˜{your project gid for template}ā€™
due_on=input_data[ā€˜dueOnā€™]
start_on=input_data[ā€˜startOnā€™]
team=ā€˜{your team where project exists}ā€™
token=ā€˜{your api token}ā€™
name=input_data[ā€˜projectnameā€™]
false=ā€˜falseā€™
url=ā€˜https://app.asana.com/api/1.0/projects/ā€˜+id+ā€™/duplicateā€™
zc='Bearer '+ token
data = {ā€œdataā€:
{ā€œincludeā€: [
ā€œmembersā€,
ā€œnotesā€,
ā€œtask_notesā€,
ā€œtask_assigneeā€,
ā€œtask_subtasksā€,
ā€œtask_attachmentsā€,
ā€œtask_datesā€,
ā€œtask_dependenciesā€,
ā€œtask_followersā€,
ā€œtask_tagsā€,
ā€œtask_projectsā€
],
ā€œnameā€:name,
ā€œschedule_datesā€: {
ā€œshould_skip_weekendsā€: false,
ā€œdue_onā€: due_on
},
ā€œteamā€:team
}
}
headers={ā€˜Content Typeā€™:ā€˜application/jsonā€™,ā€˜Acceptā€™:ā€˜application/jsonā€™,ā€˜Authorizationā€™: zc}
response=requests.post(url, json=data,headers=headers)
return response.json()

2 Likes

Is there any other code you included? Iā€™m getting this errorā€¦

Traceback (most recent call last):
File ā€œā€, line 31, in the_function
NameError: name ā€˜falseā€™ is not defined

Code below(token numbers changed):

id=ā€˜{11771254812342393}ā€™
token=ā€˜{1/21234222307:e4194f808a11653c815c641af049ebb5}ā€™
team=ā€˜{117526232307241}ā€™
name=input_data[ā€˜projectnameā€™]
start_on=input_data[ā€˜startonā€™]
url=ā€˜https://app.asana.com/api/1.0/projects/ā€˜+id+ā€™/duplicateā€™
zc='Bearer '+ token
data={ā€œdataā€:
{ā€œincludeā€: [
ā€œmembersā€,
ā€œnotesā€,
ā€œtask_notesā€,
ā€œtask_assigneeā€,
ā€œtask_subtasksā€,
ā€œtask_attachmentsā€,
ā€œtask_datesā€,
ā€œtask_dependenciesā€,
ā€œtask_followersā€,
ā€œtask_tagsā€,
ā€œtask_projectsā€
],
ā€œnameā€: name,
ā€œschedule_datesā€: {
ā€œshould_skip_weekendsā€: false,
ā€œstart_onā€: start_on
},
ā€œteamā€:team
}
}

headers={ā€˜Content Typeā€™:ā€˜application/jsonā€™,ā€˜Acceptā€™:ā€˜application/jsonā€™,ā€˜Authorizationā€™: zc}
response=requests.post(url,json=data,headers=headers)
return response.json()

You probably need to remove {} from around input data. I didnā€™t mean to include those.

Iā€™m trying to do this too, and here is my screenshot of the code:

Iā€™m getting an error of ReferenceError: Invalid left-hand side in assignment when I test it.

@FreshyJon,

Iā€™m sure that issue is coming from

false = ā€˜falseā€™

That has to be an typo in the previous code that youā€™re working off of.

Yeah, I just noticed that and took it out. Itā€™d now giving me ReferenceError: id is not defined

Ouch, thatā€™s a tougher one - @Michael_Andrew1 might know whatā€™s causing that?

Was able to get this to work by using this method instead:

Though, I do wonder if all of those include are necessary, or which ones are even accurate/valid. I donā€™t see a full list of options within the API documentation.

1 Like