I try to create an array of tasks and then to create this under the respective section, but every time I get a Invalid request. However, when I do so using the .tasks.createInWorkspace(XXXXXX, taskAsana [i]) or the .tasks.createTask(taskAsana [i]) it works and creates a new task in the project. Although when I try to do so for a particular section… it doesnt seem to work.
var taskAsana = new Array();
function x(ass, t) {
var x = {assignee: ass, name: t, project: [“XXXXXXXXXX”]};
taskAsana.push(x);
}
while (i < taskAsana.length) {
client.sections.addTask(XXXXXXXX, taskAsana[i]);
}
I try to create an array of tasks and then to create this under the respective section, but every time I get a Invalid request. However, when I do so using the .tasks.createInWorkspace(XXXXXX, taskAsana [i]) or the .tasks.createTask(taskAsana [i]) it works and creates a new task in the project. Although when I try to do so for a particular section… it doesnt seem to work.
var taskAsana = new Array();
function x(ass, t) { var x = {assignee: ass, name: t, project: [“XXXXXXXXXX”]}; taskAsana.push(x); }
while (i < taskAsana.length) { client.sections.addTask(XXXXXXXX, taskAsana[i]); }
You should be able to get the new task into a project and section by specifying the memberships property instead of the project property. Here’s an example of the format of that property: