Now available: project and task duplication!

projects
api
templates
#1

Hello everyone, we have some new API endpoints to share with you that allow you to duplicate tasks and projects in Asana! :tada: Special thanks to @Sasha_S for driving this project and the implementation!

You can now make a call to POST /projects/{project_gid}/duplicate to kick off an asynchronous “job” that will make a copy of a project and all its tasks, just like it would when a user duplicates the project in the Asana UI. The response of this call will be a new “job” object detailing the state of the duplication and indicating the new project that was created as a result. Most projects will finish duplicating in a minute or so, but you can always follow up to get the current status using GET /jobs/{job_gid}.

Additionally, there are a number of optional parameters you can send in the request to affect the duplication:

  • team, optional — allows you to specify a team for the new project. By default, the new project is created in the same team as the project it was duplicated from.
  • include, list of strings, optional — allows you to specify which attributes of the project and its tasks are copied over to the new project. The full set of available attributes is:
    • "members"
    • "task_notes"
    • "task_assignee"
    • "task_subtasks"
    • "task_attachments"
    • "task_dates"
    • "task_dependencies"
    • "task_followers"
    • "task_tags"
    • "task_projects"
  • schedule_dates, object, optional — allows you to take advantage of the new automatic due-date shifting in Asana! This object must contain the following parameters:
    • One of due_on or start_on, date — the reference date by which to shift all other dates in the project.
    • should_skip_weekends, boolean — whether or not to have the shifting calculation exclude weekends when scheduling the new tasks.

(The same process applies to POST /tasks/{task_gid}/duplicate, though the set of attributes you can include in the duplication is different. Reference the docs for the full list.)

Bundled in with this is the ability to query for templates! Projects have a boolean is_template field on them that can be used to determine if it’s been marked as a template, and the field is writable to allow you to mark it as a template through the API. For organizations, you can fetch templates on a team-by-team basis by calling GET /teams/{team_gid}/projects?is_template=true, and for workspaces you can use GET /workspaces/{workspace_gid}/projects?is_template=true. (Note that custom templates are a premium feature in Asana.)

9 Likes
Create Project as per template using developer API
pinned #2
#3

One small note: @Joe_Trollo correct me if this is wrong - if you’re querying projects and want to include the is_template field, you need to specifically ask for it via opt_fields.

#4

Nope! is_template will be included by default on project objects (though your comment made me realize it isn’t, which is a mistake, so it will be included by default after my patch makes it to production).

1 Like
#5

Hi @Joe_Trollo, what about the project/task duplication across workspaces? It sounds like the duplication is possible across teams which means the copy is possible to other organizations where the current user is a member. But workspaces (is_organization = false) do not have teams. So, is it possible to duplicate project/task from one workspace/organization to other workspaces?

#6

Hi @Mahmudul_Hasan, sorry, but data in Asana cannot be shared or moved across workspaces, only within workspaces. Copying data across requires pulling it out of Asana and then putting it back into the other workspace.