Rescheduling Subtasks using AI Studio - possible?

Hi, @Kate_Miller .
It’s not easy to set up AI Studio smoothly.

About


I ran some tests.
The instruction to “change the subtask’s due date” was not executed.

  • The existence of subtasks was recognized.
  • The subtask’s due date could not be manipulated.

So, in other words, it seems that you can’t edit subtasks in AI-Studio. As per Asana specifications, you can take action on trigger tasks. However, since tasks and subtasks are separate tasks, you can’t take action on them.


Alternatively, can eventually achieve that using “Script action”


In my testing, I was able to extract the “difference in days between before and after the change” in a task’s due date by combining “existing rules” and “custom fields.”

As a result of the above, the “difference in days between before and after the change” is recorded in the custom field. (For example, a one-day difference was recorded as 1440.)

It seems possible to use a script to change the due date of a subtask based on the value of the main task’s “difference in days between before and after the change” custom field.


For example, Copiloto’s answer was something like this. (This script is not guaranteed to be correct.)

  1. Implementation Concept
    Get the old and new due dates of the parent task.
  • When the script is executed, context.task.due_on is the new due date.
  • The old due date can be saved in custom_fields or description for comparison.
  1. Calculate the difference in days.
    const oldDueDate = new Date(“2025-09-10”); // Example: Saved old due date
    const newDueDate = new Date(context.task.due_on);
    const diffDays = Math.round((newDueDate - oldDueDate) / (1000 * 60 * 60 * 24));

  2. Get the subtask due dates and add the difference.
    const subtasks = await tasksApiInstance.getSubtasksForTask(context.task.gid);
    for (const subtask of subtasks.data) {
    const detail = await tasksApiInstance.getTask(subtask.gid);
    const subDue = detail.data.due_on;
    if (subDue) {
    const newSubDue = new Date(subDue);
    newSubDue.setDate(newSubDue.getDate() + diffDays);
    await tasksApiInstance.updateTask(subtask.gid, {
    due_on: newSubDue.toISOString().split(“T”)[0]
    });
    }
    }

2 Likes