I have been experimenting with the Google Apps Script Tasks API to create new tasks from emails. I have successfully created TasksList, and Tasks within these lists using both of the following approaches. However, I have been trying to create a child Task by using the optional "parent" resource but with little luck. I am trying to replicate the task "indent" functionality available in Google Tasks which makes a tak appear as a child of the task preceding it. Has anyone managed to get this to work using the API?
Approach 1--
taskListId = getTaskListID("My Projects");
var taskDetails = {
title: "Task 1",
notes: "This is a child task",
parent: "Project A"
};
Tasks.Tasks.insert(taskDetails, tasklistId);
Approach 2 :-
taskListId = getTaskListID("My Projects");
var newTask = Tasks.newTask().setTitle(title);
newTask.setParent("Project A");
Tasks.Tasks.insert(newTask, tasklistId);
in both cases the script creates a task ("Task 1") under a tasklist ("My Projects"), but I cannot get it to appear as a child (indented) task under the existing task ("Project A").
Anyone could shed some light on this?