Subtasks cannot be manipulated in AI-Studio.

I ran a few tests.
The command to “change the due date of a subtask” failed.

The system recognized whether a task had subtasks or not.

In other words, it seems that editing subtasks is not possible.

Due to Asana’s specifications, it is possible to perform actions on trigger tasks. However, since tasks and subtasks are separate tasks, it appears that actions cannot be performed on subtasks.


2 Likes

Hi @ka_nishiyama

Indeed, AI Studio doesn’t bypass that structural limitation. That was the first thing I’ve tested at the launch :sweat_smile:

Alternatively, you can eventually achieve that using “Script action” How to write a Script Action script (available from the Enterprise plan).

2 Likes

Hi, @Arthur_BEGOU thanks

Is it something like this??


const asana = require(‘asana’);
const client = asana.Client.create().useAccessToken(auth.access_token);

// Number of days to set N days later
const N = 3;

(async () => {
try {
// Get parent task details
const parentTask = await client.tasks.findById(task_gid);
const parentDueDate = parentTask.due_on;

if (!parentDueDate) {
console.log(“Parent task does not have a due date”);
return;
}

/ Calculate the date N days later
const date = new Date(parentDueDate);
date.setDate(date.getDate() + N);
const newDueDate = date.toISOString().split(‘T’)[0]; // YYYY-MM-DD format

/ Get a list of subtasks
const subtasks = await client.tasks.subtasks(task_gid);

// Set a new due date for each subtask
for (const subtask of subtasks) {
await client.tasks.update(subtask.gid, {
due_on: newDueDate
});
console.log(Due date ${newDueDate} set for subtask ${subtask.name});
}

} catch (error) {
console.error(“Script execution error:”, error);
}
})();

1 Like

@ka_nishiyama

It looks like a valid script, but the best judge is to test it. :slightly_smiling_face:

PS: AI tool (ChatGPT/Claude) can help to build or review the code.

1 Like

When I consulted Copilot, they said that I could use AI-Studio and script actions together.
The AI ​​would make the conditional decisions, the script would execute them, and the AI ​​would write the comments.

1 Like

Based on our experience at i.DO, script ares an alternative to AI Studio in use-cases where AI is not completely relevant (relatively simple workflows, no need to analyze data, etc…)

I’ve never tested both combined, I’m not sure how that would work. But curious to have your return on experience :wink:

1 Like

I ran into the same issue with subtasks, which was frustrating when approvals are generally created as subtasks, but you cannot use their approval to move the main task to a new section.

We’re upgrading to Ent, and I’m looking forward to the additional functionality. I haven’t tried scripts yet, but I certainly intend to.

3 Likes