Skip to content

Duplicate a task

API Reference

task_gid

string

required

The task to operate on.

opt_fields

array of strings

This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.

opt_fields ADD string

opt_pretty

boolean

Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

truetruefalse

Describes the duplicate's name and the fields that will be duplicated.

data

object

dataobject

``201 Successfully created the job to handle duplication.

object

data

object

A job is an object representing a process that handles asynchronous work.

gid

string

Globally unique identifier of the resource, as a string.

resource_type

string

The base type of this resource.

resource_subtype

string

The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.

status

string

enum

The current status of this job.

not_started``in_progress``succeeded``failed

new_portfolio

object

A portfolio gives a high-level overview of the status of multiple initiatives in Asana. Portfolios provide a dashboard overview of the state of multiple projects, including a progress report and the most recent project status update. Portfolios have some restrictions on size. Each portfolio has a max of 1500 items and, like projects, a max of 20 custom fields.

new_portfolio object

new_project

object

A project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions.

new_project object

new_task

object

Full object requires scope:tasks:read

The task is the basic object around which many operations in Asana are centered.

new_task object

new_project_template

object

A project template is an object that allows new projects to be created with a predefined setup, which may include tasks, sections, Rules, etc. It simplifies the process of running a workflow that involves a similar set of work every time.

new_project_template object

new_graph_export

object

A graph_export object represents a request to export the data starting from a parent object

new_graph_export object

new_resource_export

object

A resource_export object represents a request to bulk export objects for one or more resources.

new_resource_export object

``400 This usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.

``401 A valid authentication token was not provided with the request, so the API could not associate a user with the request.

``403 The authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you try to read or write to objects or properties that the user does not have access to.

``404 Either the request method and path supplied do not specify a known action in the API, or the object specified by the request does not exist.

``500 There was a problem on Asana’s end. In the event of a server error the response body should contain an error phrase. These phrases can be used by Asana support to quickly look up the incident that caused the server error. Some errors are due to server load, and will not supply an error phrase.

Updated 28 days ago


Did this page help you?

Yes

No

ShellNodeRubyPHPPython


xxxxxxxxxx

curl --request POST \

     --url https://app.asana.com/api/1.0/tasks/task_gid/duplicate \

     --header 'accept: application/json' \

     --header 'content-type: application/json'

xxxxxxxxxx

{

  "data": {

    "gid": "12345",

    "resource_type": "job",

    "resource_subtype": "duplicate_task",

    "status": "in_progress",

    "new_portfolio": {

      "gid": "12345",

      "resource_type": "portfolio",

      "name": "Bug Portfolio"

    },

    "new_project": {

      "gid": "12345",

      "resource_type": "project",

      "name": "Stuff to buy"

    },

    "new_task": {

      "gid": "12345",

      "resource_type": "task",

      "name": "Bug Task",

      "resource_subtype": "default_task",

      "created_by": {

        "gid": "1111",

        "resource_type": "user"

      }

    },

    "new_project_template": {

      "gid": "12345",

      "resource_type": "project_template",

      "name": "Packing list"

    },

    "new_graph_export": {

      "gid": "12345",

      "resource_type": "graph_export",

      "created_at": "2012-02-22T02:06:58.147Z",

      "download_url": "https://asana-export-us-east-1.s3.us-east-1.amazonaws.com/2563645399633793/domain_export/7588024658887731/download/ domain_export_2563645399633793_7588024658887731_2023018-201726.json.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256& X-Amz-Content-Sha256=xxxxxxxx&X-Amz-Date=xxxxxxxx&X-Amz-Expires=300&X-Amz-Security-Token=xxxxxxxx& X-Amz-Signature=xxxxxxxx&X-Amz-SignedHeaders=host&x-id=GetObject#_=_",

      "completed_at": "2012-02-22T03:06:58.147Z"

    },

    "new_resource_export": {

      "gid": "12345",

      "resource_type": "export_request",

      "created_at": "2012-02-22T02:06:58.147Z",

      "download_url": "https://asana-export-us-east-1.s3.us-east-1.amazonaws.com/2563645399633793/object_export/7588024658887731/download/ object_export_2563645399633793_7588024658887731_2023018-201726.jsonl.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256& X-Amz-Credential=xxxxxxxx&X-Amz-Date=xxxxxxxx&X-Amz-Expires=300&X-Amz-Security-Token=xxxxxxxx& X-Amz-Signature=xxxxxxxx&X-Amz-SignedHeaders=host",

      "completed_at": "2012-02-22T03:06:58.147Z"

    }

  }

}

Updated28 days ago


Did this page help you?

Yes

No