# Script Action or AI

**URL:** <https://forum.asana.com/t/script-action-or-ai/1109345>\
**Category:** Ask the Community\
**Tags:** script-actions, ai-studio, agentic-work-management, rules\
**Created:** [17 November 2025 13:30 UTC](https://forum.asana.com/t/script-action-or-ai/1109345 "2025-11-17T13:30:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danni\_VanguardCC](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/danni_vanguardcc/32/283488_2.png) [@Danni\_VanguardCC](https://forum.asana.com/u/Danni_VanguardCC)\
**Post date:** [17 November 2025 13:30 UTC](https://forum.asana.com/t/script-action-or-ai/1109345/1 "2025-11-17T13:30:10Z")

</div>

Hey All,

I am trying to essentially get a main task to update its custom field from subtask custom fields.

For example when any subtask is set to in progress, mark the main task as in progress.

Either I am desperately overcomplicating things or AI rules do not seem to be able to do it.

Perhaps a script action?

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [17 November 2025 13:58 UTC](https://forum.asana.com/t/script-action-or-ai/1109345/2 "2025-11-17T13:58:43Z")

</div>

AI cannot help because it can’t update “another” task, only a script can do it.

---

<div class="post-metadata">

**Author:** ![Arthur\_BEGOU](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/arthur_begou/32/279746_2.png) [@Arthur\_BEGOU](https://forum.asana.com/u/Arthur_BEGOU)\
**Post date:** [17 November 2025 14:04 UTC](https://forum.asana.com/t/script-action-or-ai/1109345/3 "2025-11-17T14:04:09Z")

</div>

Yes, I would advise using Script Action.

Something like that:

1- When “trigger to be defined”

2- Then, add a script action

```auto
async function run() {
  const pillarCustomFieldGid = '1209785914660601';

  const triggeringTask = await tasksApiInstance.getTask(task_gid, {
    opt_fields: `parent.custom_fields.gid,parent.custom_fields.enum_value.gid`
  });

  if(triggeringTask.data.parent) {
    const parentPillarGid = triggeringTask.data.parent.custom_fields.find(
    f => f.gid === pillarCustomFieldGid
  )?.enum_value?.gid;

  log("Current pillar is now: " + parentPillarGid);

  if (!parentPillarGid) {
    log("No pillar value found. Skipping update.");
    return;
  }
  
  await tasksApiInstance.updateTask({
        data: {
          custom_fields: {
            [pillarCustomFieldGid]: parentPillarGid
          }
        }
      }, task_gid);

      log("Task updated: " + task_gid);
 
  }
  
}

run();

```

PS: this is a basic script, feel free to re-work it with your favorite LLM tool to adapt it to your needs.  
PSS: I would recommend using the Script action “Run History” to read the logs and eventually improve it. example:

 ![image](https://us1.discourse-cdn.com/asana/original/4X/0/f/0/0f0862cae03d6f3eff4e0023fb9a7e16d055827a.png)

---

<div class="post-metadata">

**Author:** ![Danni\_VanguardCC](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/danni_vanguardcc/32/283488_2.png) [@Danni\_VanguardCC](https://forum.asana.com/u/Danni_VanguardCC)\
**Post date:** [17 November 2025 14:10 UTC](https://forum.asana.com/t/script-action-or-ai/1109345/4 "2025-11-17T14:10:51Z")

</div>

Yeah I thought so

---

<div class="post-metadata">

**Author:** ![Larry\_Berger\_lpb](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/larry_berger_lpb/32/276017_2.png) [@Larry\_Berger\_lpb](https://forum.asana.com/u/Larry_Berger_lpb)\
**Post date:** [18 November 2025 03:40 UTC](https://forum.asana.com/t/script-action-or-ai/1109345/5 "2025-11-18T03:40:52Z")

</div>

@Danni_VanguardCC, I’m pretty sure you can achieve what you need with @Richard_Sather’s:

> [@rocket Automated task status based on completion of subtasks](https://forum.asana.com/t/automated-task-status-based-on-completion-of-subtasks/959664):
>
> Similar to my workaround for [battery Automated task progress battery bars to show completion of subtasks](https://forum.asana.com/t/automated-task-progress-battery-bars-to-show-completion-of-subtasks/959387), this workaround will automatically update the status of a parent task, based on the completion of subtasks! Below is a small preview where we see that the rocket Stage field of the parent task automatically displays the subtask that is currently in progress. :exclamation:Note that this workaround works with predefined subtasks which could either be created using a Task templ…

…but you may not want to because it’s a few moving parts.

But just including that here for completeness’ sake.

Thanks,

Larry
