asana@4.0.5
- 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)
This adaptor exports the following from common:
- alterState()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- http
- lastReferenceValue()
- merge()
- sourceValue()
Functions
createTask
createTask(params, callback) ⇒ Operation
Create a task.
Param | Type | Description |
---|---|---|
params | object | Body parameters |
callback | function | (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.
Param | Type | Description |
---|---|---|
taskGid | string | Globally unique identifier for the task |
params | StoryOptions | Story parameters |
callback | function | (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.
Param | Type | Description |
---|---|---|
taskGid | string | Globally unique identifier for the task |
params | object | Query params to include. |
callback | function | (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.
Param | Type | Description |
---|---|---|
projectGid | string | Globally unique identifier for the project |
params | object | Query params to include. |
callback | function | (Optional) callback function |
Example
getTasks("1206933955023739", {
opt_fields: "name,notes,assignee",
});
request
request(path, params, callback) ⇒ Operation
Make a HTTP request against the Asana API.
Param | Type | Description |
---|---|---|
path | string | Path to resource (excluding api/version) |
params | RequestOptions | (Optional) Query, body and method parameters |
callback | function | (Optional) Callback function |
Example
Get a task by id
request("/tasks/1234");
Example
Query for tasks in a given project
request("/tasks", {
query: { project: "abc" },
});
Example
Create a new task
request("/tasks", {
method: "POST",
body: { data: { name: "do the thing", completed: false } },
});
updateTask
updateTask(taskGid, params, callback) ⇒ Operation
Update a specific task.
Param | Type | Description |
---|---|---|
taskGid | string | Globally unique identifier for the task |
params | object | Body parameters |
callback | function | (Optional) callback function |
Example
updateTask("1206933955023739", {
name: "test",
approval_status: "pending",
assignee: "12345",
});
upsertTask
upsertTask(projectGid, params, callback) ⇒ Operation
Update or create a task.
Param | Type | Description |
---|---|---|
projectGid | string | Globally unique identifier for the project |
params | object | an object with an externalId and some task data. |
callback | function | (Optional) callback function |
Example
upsertTask("1201382240880", {
externalId: "name",
data: {
name: "test",
approval_status: "pending",
projects: ["1201382240880"],
assignee: "12345",
},
});
Interfaces
RequestOptions
Options provided to the Asana API request
Properties
Name | Type | Description |
---|---|---|
body | object | Body data to append to the request. |
query | object | An object of query parameters to be encoded into the URL. |
method | string | The HTTP method to use. Defaults to GET |
StoryOptions
Options provided to the createTaskStory request
Properties
Name | Type | Description |
---|---|---|
text | string | The plain text of the comment to add. Cannot be used with html_text. |
html_text | string | Opt In. HTML formatted text for a comment. This will not include the name of the creator. |
is_pinned | boolean | Default to false . Whether the story should be pinned on the resource. |
sticker_name | string | The name of the sticker in this story. null if there is no sticker. |
opt_fields | array | Opt 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_pretty | boolean | Defaults 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. |