Skip to content

Tasks.API

Phips Peter edited this page Oct 22, 2014 · 7 revisions

Class: Tasks

Tasks

new Tasks(dispatcher)

Access to the Tasks resource

Parameters:
Name Type Description
dispatcher Dispatcher

The API dispatcher

Source:

Methods

addFollowers(taskId, data)

Dispatches a POST request to /tasks/:taskId/addFollowers with to add followers to the task.

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data containing the list of followers

Source:

addFollowers(taskId, data)

Dispatches a POST request to /tasks/:taskId/addFollowers with to add followers to the task.

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data containing the list of followers

Source:

addProject(taskId, data) → {Promise}

Dispatches a POST request to /tasks/:taskId/addProject with the project to add to to the task.

Parameters:
Name Type Description
taskId Number

The task id

data Number

The data containing the projectId

Source:
Returns:

The result of the API call

Type
Promise

addSubtask(taskId, data) → {Promise}

Creates a new subtask

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data for the subtask

Source:
Returns:

The result of the API call

Type
Promise

addTag(taskId, data) → {Promise}

Add a tag to a task

Parameters:
Name Type Description
taskId Number

The task id

data Number

The data containing the tagId

Source:
Returns:

The result of the API call

Type
Promise

create(data) → {Promise}

Creates a new task

Parameters:
Name Type Description
data Object

The data for the task

Source:
Returns:

The result of the API call

Type
Promise

createInWorkspace(workspaceId, data) → {Promise}

Creates a new task in the workspace

Parameters:
Name Type Description
workspaceId Number

The workspace id

data Object

The data for the task

Source:
Returns:

The result of the API call

Type
Promise

delete(taskId) → {Promise}

Deletes a task

Parameters:
Name Type Description
taskId Number

The task id

Source:
Returns:

The result of the API call

Type
Promise

delete(taskId) → {Promise}

Deletes a task

Parameters:
Name Type Description
taskId Number

The task id

Source:
Returns:

The result of the API call

Type
Promise

findAll(params) → {Promise}

Returns all tasks that the dispatcher has access to

Parameters:
Name Type Argument Description
params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

findById(taskId, params) → {Promise}

Returns the task

Parameters:
Name Type Argument Description
taskId Number

The task id

params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

findByProject(projectId, params) → {Promise}

Finds a task by project

Parameters:
Name Type Argument Description
projectId Number

The project id

params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

findByTag(tagId, params) → {Promise}

Finds a task by tag

Parameters:
Name Type Argument Description
tagId Number

The tag id

params Object <optional>

Extra params for the dispatcher

Source:
Returns:

The result of the API call

Type
Promise

projects(taskId) → {Promise}

Dispatches a GET request to /tasks/:taskId/projects

Parameters:
Name Type Description
taskId Number

The task id

Source:
Returns:

The result of the API call

Type
Promise

removeFollowers(taskId, data)

Dispatches a POST request to /tasks/:taskId/removeFollowers with to remove followers from the task.

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data containing the list of followers

Source:

removeProject(taskId, data) → {Promise}

Dispatches a POST request to /tasks/:taskId/removeProject with the project to remove from the task

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data containing the projectId

Source:
Returns:

The result of the API call

Type
Promise

removeTag(taskId, data) → {Promise}

Dispatches a POST request to /tasks/:taskId/removeTag with the tag to remove from the task

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data containing the tagId

Source:
Returns:

The result of the API call

Type
Promise

setParent(taskId, parentId) → {Promise}

Sets the parent for a task

Parameters:
Name Type Description
taskId Number

The task id

parentId Number

The id of the parent task

Source:
Returns:

The result of the API call

Type
Promise

subtasks(taskId) → {Promise}

Gets all subtasks for a task

Parameters:
Name Type Description
taskId Number

The task id

Source:
Returns:

The result of the API call

Type
Promise

tags(taskId) → {Promise}

Get tags associated with a task

Parameters:
Name Type Description
taskId Number

The task id

Source:
Returns:

The result of the API call

Type
Promise

update(taskId, data) → {Promise}

Update a task

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data to be sent to the workspace

Source:
Returns:

The result of the API call

Type
Promise

update(taskId, data, taskId, data) → {Promise}

Dispatches a POST request to /tasks/:taskId/removeFollowers with to remove followers from the task.

Parameters:
Name Type Description
taskId Number

The task id

data Object

The data containing the list of followers };

/** Update a task

taskId Number

The task id

data Object

The data to be sent to the workspace

Source:
Returns:

The result of the API call

Type
Promise

Generated with wicked.
Clone this wiki locally