title: How to create a child task in Google Apps Script Tasks API
body: <p>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? </p>
  
  <p>Approach 1--</p>
  
  <pre><code>taskListId = getTaskListID("My Projects");
  var taskDetails = {
    title: "Task 1",
    notes: "This is a child task",
    parent: "Project A"
  };
  Tasks.Tasks.insert(taskDetails, tasklistId);
  </code></pre>
  
  <p>Approach 2 :-</p>
  
  <pre><code>taskListId = getTaskListID("My Projects");
  var newTask = Tasks.newTask().setTitle(title);
  newTask.setParent("Project A");
  Tasks.Tasks.insert(newTask, tasklistId);
  </code></pre>
  
  <p>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").</p>
  
  <p>Anyone could shed some light on this?</p>