Skip to main content

asana@3.2.0

Functions

createTask(params, callback)
createTaskStory(taskGid, params, callback)
getTask(taskGid, params, callback)
getTasks(projectGid, params, callback)
request(path, params, callback)
updateTask(taskGid, params, callback)
upsertTask(projectGid, params, callback)

The following functions are exported from the common adaptor:

alterState()
cursor()
dataPath()
dataValue()
dateFns()
each()
field()
fields()
fn()
http()
lastReferenceValue()
merge()
sourceValue()

createTask

createTask(params, callback) ⇒ Operation

Create a task.

ParamTypeDescription
paramsobjectBody parameters
callbackfunction(Optional) callback function

Example

createTask({
name: "test",
approval_status: "pending",
assignee: "12345",
projects: ["1206933955023739"],
});

createTaskStory

createTaskStory(taskGid, params, callback) ⇒ Operation

Create a story to a specific task.

ParamTypeDescription
taskGidstringGlobally unique identifier for the task
paramsStoryOptionsStory parameters
callbackfunction(Optional) callback function

Example (Create a plain text comment)

createTaskStory("1206933955023739", {
text: "This is a comment",
});

Example (Create a HTML formatted text comment)

createTaskStory("1206933955023739", {
html_text: "<body>This is a comment</body>",
});

getTask

getTask(taskGid, params, callback) ⇒ Operation

Get a single task of a given project.

ParamTypeDescription
taskGidstringGlobally unique identifier for the task
paramsobjectQuery params to include.
callbackfunction(Optional) callback function

Example

getTask("1206933955023739", {
opt_fields: "name,notes,assignee",
});

getTasks

getTasks(projectGid, params, callback) ⇒ Operation

Get the list of tasks for a given project.

ParamTypeDescription
projectGidstringGlobally unique identifier for the project
paramsobjectQuery params to include.
callbackfunction(Optional) callback function

Example

getTasks("1206933955023739", {
opt_fields: "name,notes,assignee",
});

request

request(path, params, callback) ⇒ Operation

Make a request in Asana API

ParamTypeDescription
pathstringPath to resource
paramsRequestOptionsQuery, body and method parameters
callbackfunction(Optional) Callback function

Example

request("/asanaEndpoint", {
method: "POST",
query: { foo: "bar", a: 1 },
});

RequestOptions

RequestOptions : Object

Options provided to the Asana API request

Properties

NameTypeDescription
bodyobjectBody data to append to the request.
queryobjectAn object of query parameters to be encoded into the URL.
methodstringThe HTTP method to use. Defaults to GET

StoryOptions

StoryOptions : Object

Options provided to the createTaskStory request

Properties

NameTypeDescription
textstringThe plain text of the comment to add. Cannot be used with html_text.
html_textstringOpt In. HTML formatted text for a comment. This will not include the name of the creator.
is_pinnedbooleanDefault to false. Whether the story should be pinned on the resource.
sticker_namestringThe name of the sticker in this story. null if there is no sticker.
opt_fieldsarrayOpt In. This endpoint returns a compact 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_prettybooleanDefaults to false. 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.

updateTask

updateTask(taskGid, params, callback) ⇒ Operation

Update a specific task.

ParamTypeDescription
taskGidstringGlobally unique identifier for the task
paramsobjectBody parameters
callbackfunction(Optional) callback function

Example

updateTask("1206933955023739", {
name: "test",
approval_status: "pending",
assignee: "12345",
});

upsertTask

upsertTask(projectGid, params, callback) ⇒ Operation

Update or create a task.

ParamTypeDescription
projectGidstringGlobally unique identifier for the project
paramsobjectan object with an externalId and some task data.
callbackfunction(Optional) callback function

Example

upsertTask("1201382240880", {
externalId: "name",
data: {
name: "test",
approval_status: "pending",
projects: ["1201382240880"],
assignee: "12345",
},
});