Our Blog

Asana: Script Actions Webinar Pre-Read

16 min read

A pre-read for the Asana Script Actions webinar: where Script Actions sit next to AI Teammates and AI Studio rules inside the Asana Work Graph.

Hello!

Hopefully you’re reading this to get yourself ready for my upcoming Script Actions webinar. You should have completed some formal Asana certifications prior, and feel comfortable with the general operation of Asana and the functions. As Asana positions itself as the Operating System for Human-Agent Work, that phrase got me thinking about what it actually means to be an operating system. The more I look at Asana’s Work Graph, the more it feels like a natural step in the evolution of agentic transformation.

Most operating systems have hidden layers of power sitting just beneath the surface. Windows has Command Prompt and PowerShell. macOS has Terminal. Linux has Bash. Even something like CUPS for print management has a whole world of capability hidden away if you know where to look.

And the people who understand those deeper layers? They become the masters of their domain!

For Asana, one of those deeper layers is Script Actions. It’s my goal to help you understand where they fit versus AI Teammates and AI Studio rules. I believe strongly that all three combined it what truly creates the powerful Operating System for Human-Agent Work, and gives the Work Graph resiliency and the structural engineering to scale your organisation beyond those trying to implement AI alone.

This pre-read is designed to get you warmed up before the Script Actions Webinar. By the end, you’ll understand the basic concepts, know what you need to get started, and hopefully have run your first Script Action up and running. If you’ve already made a basic Script Action, then I still recommend skimming through this to ensure you’re across my terminology and communication style (pro tip, i use a lot of analogies - https://www.youtube.com/watch?v=mT3szPEb8aQ (opens in a new tab))

Ok - Let’s get into it.

Responsible Automation

Taco started out as Copy Monitoring Systems, we helped organisations with digital transformation, we took paper-based processes and moved them into the digital sphere.

Now we’re doing that again with AI transformation. The key to successful transformation was always being deliberate, not everything needs to be digital, and there’s no point in scanning a bunch of paper documents to some big cloud storage if no one can make sense of them or find them again.

Agentic AI is starting to give people access to skills and functions that were previously out of reach unless you were a developer, specialist, or someone who had spent far too long reading API documentation late at night.

When the internet exploded alongside personal computers in the 1990s, it gave us millions of websites, new business models, and a whole new digital economy. It also gave us banner ads, pop-ups, and a fair bit of advertising slop. I’m sure when green screens and digital production started taking off, the artists doing traditional photo shoots had a few things to say about that too.

New technology changes the shape of work. But it doesn’t remove the need for human judgement.

AI can help us gather our thoughts, structure information, lay things out, and offer perspectives on how something might be received by a broader audience. But we should still be deliberate about what we use AI for.

As individuals, teams, and organisations, we also have a responsibility to think about our Environmental, Social and Governance (ESG) impacts. Automatically assigning every bit of work to an AI agent risks creating noise, and unchecked it could create memories and ultimately diverge from the core mission of an organisation.

Think about when you look for a recipe online and find one of those blog-style pages with a million ads, pop-ups, and someone’s entire life story before you finally get to the ratio of flour to butter.

That’s what unchecked automation can feel like in any workflow - add AI into that, and you’re quickly creating noise that people will ultimately drown out.

So as we explore Script Actions, the goal isn’t also to automate everything just because we can. The goal is to use automation where it genuinely adds value, and be deliberate about when AI Teammates and AI Studio fits into the workflow.

Why Script Actions Matter

So, with all of that in mind, let’s come back to Asana as an operating system.

If Asana is the OS for Human-Agent Work, then Script Actions are one of the ways we unlock the deeper power of that operating system.

You’ll need to be on an Enterprise or Enterprise+ Asana plan to access Script Actions. But I’d think about this a bit like moving from a MacBook Air to a Mac Pro, or from Windows Home to Windows Professional.

As a consumer it can be hard to see the difference as they both let you do the basics - but I can tell you that when I’ve got Adobe, Chrome, Codex, Asana, Teams, Slack (yes both!) all open on my computer, the MacPro works far better than a MacAir. When Taco went through our ISO27001 compliance journey a few years ago too we had some pretty expensive PCs that had Windows Home when purchased, we updated them to Windows Pro and installed things like Intune - and users complained about slowness.

More professional capability, more governance, more control, and more power all come with a different kind of platform investment.

If you’re already on Enterprise and you’re not using Script Actions, then you’re probably not maximising the investment.

And if you’re on Advanced but starting to need Enterprise features like SSO/SAML, data residency, or more sophisticated governance, then Script Actions are a great way to help prove business value to leadership.

They are one of those features that can shift Asana from “a great work management tool” into something much closer to a genuine operational layer for your business.

Who Can Use Script Actions?

You’ll also need the right permissions in the project where you’re creating the rule. In practical terms, that usually means being a project editor or project admin.

A few important things to know upfront:

  • Script Actions are authenticated as the user who creates or connects them.
  • Actions performed by the script are treated as if that user performed them.
  • This means onboarding, offboarding, and ownership matter.
  • Scripts currently only interact with the Asana API, not arbitrary external APIs.
  • Scripts need to be added to the relevant projects or portfolio rules where you want them to run.

Good automation needs good operational hygiene. Consider reserving a seat as a service account if you can, this can help keep users’ inbox and notification clear, and helps with long term resiliency.

Getting Familiar With the Language

Before we get into the how-to, let’s make sure we’re speaking the same language.

By this point, you’re probably familiar with tasks, projects, portfolios, and the general structure of the Asana Work Graph. You may also already know about concepts like multihoming.

But it’s worth doing a quick refresher, because Script Actions sit right on top of these concepts.

The Asana Work Graph

The Work Graph is Asana’s underlying data model. It’s the connective tissue between tasks, projects, portfolios, goals, users, custom fields, and all the other objects that make work visible and actionable.

I think of it a bit like a building. 🏢

Tasks and projects are the foundation. They are the concrete slab and framing of the building. If those foundations are weak, everything above them becomes harder to trust.

Portfolios and goals are the upper floors. They give you visibility, structure, and reporting at scale, but they only work properly if the underlying tasks and projects are set up well.

Goals, Capacity Plans and Universal Reporting are the Penthouses. They only have value if you’ve built something strong, that people can trust.

Subtasks are like underground car parking. They can be very useful. Sometimes they are absolutely necessary. But they are not what holds the whole building up.

Multihoming

Multihoming means a single task can belong to more than one project at the same time. (Multihoming is all over the work graph if you know where to look! It’s exceptionally important to understand the concept, and how it relates to custom field library hygiene)

This is truly amazing engineering on Asana’s part. It’s like when you see those buildings that are cantilevered or defy physics. But it’s also how things can go wrong very quickly if you don’t take a moment to plan.

Reference Projects

Throughout the webinar, I’ll refer to Reference Projects. A Reference Project is basically a lookup database inside Asana.

It’s a project that stores useful information, but it’s not really where active work happens.

For example, a Reference Project might store:

  • Customers
  • Vendors
  • Employees
  • Systems
  • Locations
  • Standard service items
  • Cost centres
  • Categories or classifications

In these projects, tasks usually represent records rather than pieces of work.

Reference Project tasks often won’t have due dates. Instead, you might use date custom fields for important date information. They also often won’t be assigned to anyone, because they aren’t tasks in the traditional “someone needs to do this by Friday” sense.

Once you get comfortable with Reference Projects, they become extremely useful for more sophisticated automation patterns.

They let Asana behave a little bit more like a structured business system, without needing to leave the Work Graph.

Custom Fields

A solid understanding of custom fields is essential for Script Actions.

Custom fields are where a lot of the real structure in Asana lives. They let you move beyond free-text work management and start creating consistent, reportable, automatable data.

Here are the main custom field types you should be familiar with.

Text

Text fields allow free-form text entry. They’re useful for short notes, IDs, descriptions, references, or simple values that don’t need to be selected from a list, especially if that information comes from an external source/system like an Invoice Number, or an email address. They are useless from a reporting POV though, so use them sparingly.

Number

Number fields store numeric values.

They’re useful for budgets, quantities, scores, estimates, counts, and other measurable values.

Enum / Single-Select

Enum fields are single-select dropdown fields.

Only one option can be selected at a time. In the API, these values are usually handled through enum_value.

These are great for statuses, categories, priorities, classifications, or anything where one clear answer should be selected.

Multi-Enum / Multi-Select

Multi-enum fields are multi-select dropdown fields.

More than one option can be selected at the same time. In the API, these values are usually handled through multi_enum_values.

These are useful when something can belong to multiple categories or have multiple applicable attributes.

Date

Date fields store dates, and sometimes date-time values depending on configuration.

They are particularly useful in Reference Projects where the task itself may not have a due date, but the record still needs date-based information. For me the Due Date should only be used for actual Due Dates of a task.

People

People fields reference Asana users.

They’re useful for tracking stakeholders, owners, contributors, reviewers, approvers, or other people connected to a piece of work. People often create Enum fields for People. But People Field is the much cleaner way to go.

Reference

Reference fields link to other Asana objects, such as tasks, projects, portfolios, or goals.

This is where things start to get really interesting, because reference fields can help create structured relationships across the Work Graph.

Formula

Formula fields calculate values based on other fields.

They’re read-only and useful for derived metrics, calculations, scores, and rollups.

GIDs: The Phone Numbers of Asana

To create Script Actions, you’ll need to become familiar with GIDs, or Global Identifiers.

Think of a GID like getting someone’s phone number instead of just finding them on email, Messenger, Instagram, or LinkedIn. If you want to call the exact person, you need the right number.

In Asana, if you want your script to act on the exact task, project, portfolio, workspace, or custom field, you need the GID.

Every important object in Asana has one.

You’ll commonly work with:

  • Task GIDs
  • Project GIDs
  • Portfolio GIDs
  • Workspace GIDs
  • Custom Field GIDs
  • Enum Option GIDs

You can often find task and project GIDs in the Asana URL.

For example:

https://app.asana.com/1/{Workspace}/project/{Project_GID}/task/{Task_GID}

You can find your workspace GID by visiting the workspace endpoint while logged into Asana:

https://app.asana.com/api/1.0/workspaces

For custom field GIDs, one of the easiest ways is to use the Asana API Explorer (opens in a new tab), which we’ll look at shortly.

Bearer Tokens / Personal Access Tokens

You’ll also need a Bearer Token, also known as a Personal Access Token or PAT, for local testing and for using the API Explorer.

Important note: Treat it like a password, do not expose your token to anyone.

To create one:

  1. Go to the Asana Developer Console (opens in a new tab).
  2. Create a new Personal Access Token.
  3. Copy it and store it securely.
  4. Use it in API requests as:
Bearer YOUR_TOKEN_HERE

Your token is what authorises API calls as you, so keep it safe.

Setting Up Your First Script Action Rule

Here’s the general flow for creating a Script Action rule:

  1. Open the project where you want the rule to run.
  2. Go to Customize.
  3. Go to Rules.
  4. Create a custom rule.
  5. Choose your trigger.
  6. For testing, a manual trigger can be very helpful.
  7. Choose External actions.
  8. Select Run script.
  9. Paste your script into the editor.
  10. Publish the rule.
  11. Test it on a safe task.

Pre-Webinar Exercise: Explore the API

Before the webinar, I’d like you to spend a few minutes with the Asana API Explorer.

It sounds more intimidating than it is. Open Asana in a browser window (not the app. If you’re used to using the App you can use https://asana.com/?noredirect=true (opens in a new tab) to make sure the app doesn’t automatically open, you'll need these to easily extract GIDs from the URL)

Head to: https://developers.asana.com/reference/gettask (opens in a new tab)

Then:

  1. Pick a task from your Asana environment. (the last part of the URL when you have a task selected example https://app.asana.com/1/1workspace****/project/1project******/task/123*****456123456 <-- This end bit only)
  2. Copy the task GID from the task URL.
  3. Insert your Bearer Token. (image. 1)
  4. Add the task GID. (image. 2)
  5. Under query parameters, add custom_fields as an opt field.
  6. Press Try It. (image. 4)
  7. Copy the JSON response into a document. (image. 5)

Then, if you want to make life easier, copy the result into your AI tool of choice and ask:

Help explain this to me and give me a table of the response including Project, Tasks, Custom Fields and their types, include the GIDs.

This exercise will help you see how Asana structures data behind the scenes.

Once you see the JSON response, the idea of Script Actions becomes much less mysterious.

Your First Script Action

Now you’re ready to write your first script.

The sample script below is designed to help you understand the general flow of a Script Action. It’s intentionally practical, but still simple enough to follow.

What This Script Does

When triggered from a task, the script will:

  1. Get the trigger task.
  2. Find the project the task belongs to.
  3. Read a custom field value from the trigger task.
  4. Add that project to a portfolio.
  5. Set the same custom field value on the project.
  6. Log what happened along the way.

In plain English:

The task has a custom field value. The script finds the project that task lives in, adds the project to a portfolio, and then copies the same custom field value onto the project.

That’s a useful pattern because it shows how task-level data can drive project or portfolio-level structure.

Before Running the Script

Before running this, set up a small test environment.

Do not test this on your most important live executive reporting portfolio unless you enjoy spicy afternoons.

Create:

  1. A test portfolio.
  2. An enum custom field on that portfolio. This can be single-select or multi-select.
  3. A test project with the same custom field.
  4. A test task inside that project.
  5. A selected value on the task’s custom field.

Then:

  1. Copy the portfolio GID.
  2. Use the API Explorer to get the custom field GID.
  3. Paste those values into the script.
  4. Create a rule in the test project.
  5. Use External Actions > Run Script.
  6. Paste in the script.
  7. Run the rule.

You’ll need to update these two constants:

const PORTFOLIO_GID = 'PASTE_PORTFOLIO_GID_HERE';
const CUSTOM_FIELD_GID = 'PASTE_CUSTOM_FIELD_GID_HERE';

Leave the quotation marks in place.

For example:

const PORTFOLIO_GID = '1234567890123456';

Sample Script

/**
 * SCRIPT ACTION TEMPLATE
 * Add the task's project to a portfolio, then copy an enum custom field value
 * from the trigger task onto that project in the portfolio.
 *
 * WHAT THIS SCRIPT DOES:
 * 1. Runs from an Asana Rule on a task.
 * 2. Gets the trigger task.
 * 3. Finds the project that the trigger task belongs to.
 * 4. Adds that project to a portfolio.
 * 5. Reads a custom field value from the trigger task.
 * 6. Sets the same custom field value on the project in the portfolio.
 *
 * WHAT THE USER MUST PROVIDE:
 * - The Portfolio GID.
 * - The Custom Field GID.
 *
 * IMPORTANT NOTES:
 * - This template is designed for enum custom fields.
 * - It supports single-select enum fields and multi-select enum fields.
 * - The same custom field should be available on both:
 *   1. the trigger task, and
 *   2. the portfolio/project field setup.
 * - If the task is in multiple projects, this script uses the first project it finds
 *   unless you configure PROJECT_GIDS_TO_IGNORE.
 */

const PORTFOLIO_GID = 'PASTE_PORTFOLIO_GID_HERE';
const CUSTOM_FIELD_GID = 'PASTE_CUSTOM_FIELD_GID_HERE';

/**
 * OPTIONAL CONFIGURATION
 * Leave this empty unless you want to exclude certain projects.
 *
 * Example:
 * const PROJECT_GIDS_TO_IGNORE = ['PASTE_PROJECT_GID_TO_IGNORE_HERE'];
 */

const PROJECT_GIDS_TO_IGNORE = [];

/**
 * Finds the custom field on a task or project by GID.
 */
function findCustomField(customFields, customFieldGid) {
  return (customFields || []).find(field => field.gid === customFieldGid);
}

/**
 * Gets enum value GIDs from a custom field.
 *
 * Single-select enum fields usually use:
 * - enum_value
 *
 * Multi-select enum fields usually use:
 * - multi_enum_values
 */
function getEnumValueGids(customField) {
  if (!customField) {
    return [];
  }

  if (customField.enum_value && customField.enum_value.gid) {
    return [customField.enum_value.gid];
  }

  if (Array.isArray(customField.multi_enum_values)) {
    return customField.multi_enum_values
      .filter(option => option && option.gid)
      .map(option => option.gid);
  }

  return [];
}

/**
 * Main Script Action function.
 */
async function run() {
  const triggerTaskGid = task_gid;

  log(`Starting script for trigger task: ${triggerTaskGid}`);

  const taskResult = await tasksApiInstance.getTask(triggerTaskGid, {
    opt_fields: [
      'gid',
      'name',
      'memberships.project.gid',
      'memberships.project.name',
      'custom_fields.gid',
      'custom_fields.name',
      'custom_fields.type',
      'custom_fields.enum_value.gid',
      'custom_fields.enum_value.name',
      'custom_fields.multi_enum_values.gid',
      'custom_fields.multi_enum_values.name'
    ].join(',')
  });

  const task = taskResult.data;

  if (!task) {
    throw new Error('Could not fetch trigger task.');
  }

  log(`Trigger task found: ${task.name || task.gid}`);

  const memberships = task.memberships || [];

  const usableMembership = memberships.find(membership => {
    const projectGid = membership?.project?.gid;
    return projectGid && !PROJECT_GIDS_TO_IGNORE.includes(projectGid);
  });

  if (!usableMembership || !usableMembership.project || !usableMembership.project.gid) {
    log('No usable project found on the trigger task. Script stopped.');
    return;
  }

  const projectGid = usableMembership.project.gid;
  const projectName = usableMembership.project.name || projectGid;

  log(`Project selected: ${projectName} (${projectGid})`);

  const sourceField = findCustomField(task.custom_fields, CUSTOM_FIELD_GID);

  if (!sourceField) {
    log(`Custom field ${CUSTOM_FIELD_GID} was not found on the trigger task. Script stopped.`);
    return;
  }

  const enumValueGids = getEnumValueGids(sourceField);

  if (!enumValueGids.length) {
    log('The custom field is empty on the trigger task. Script stopped.');
    return;
  }

  log(`Found ${enumValueGids.length} enum value(s) to copy.`);

  try {
    await portfoliosApiInstance.addItemForPortfolio(PORTFOLIO_GID, {
      body: {
        data: {
          item: projectGid
        }
      }
    });

    log(`Project added to portfolio: ${projectName}`);
  } catch (error) {
    log('Could not add project to portfolio. It may already be in the portfolio.');
    log(error.message || JSON.stringify(error));
  }

  const valueToSet = sourceField.type === 'multi_enum'
    ? enumValueGids
    : enumValueGids[0];

  await projectsApiInstance.updateProject(projectGid, {
    data: {
      custom_fields: {
        [CUSTOM_FIELD_GID]: valueToSet
      }
    }
  });

  log(`Updated project custom field ${CUSTOM_FIELD_GID}.`);
  log('Script finished successfully.');
}

run();

A Note on Multihoming

If you use this script on tasks that are multihomed into several projects, you’ll need to be careful.

The script needs to know which project it should act on.

For this pre-work, keep it simple. Use one test task in one test project and one test portfolio.

If you want to expand from there, you can either:

  • populate PROJECT_GIDS_TO_IGNORE, or
  • add more selection logic so the script can choose the correct project.

Debugging With AI

If you run into issues, copy the script and the error message into your AI assistant of choice.

ChatGPT, Claude, Copilot, Gemini, or Asana’s own AI features can all help explain what’s going wrong.

A useful prompt is:

I am testing an Asana Script Action. Here is my script and the error from the run history. Please explain what the error means and suggest the smallest safe fix.

The important thing is to include:

  • the script,
  • the exact error message,
  • what you expected to happen,
  • what actually happened.
  • Do NOT include your Bearer Token / PAT

Debugging becomes much easier when the AI can see the full context.

As with all things AI, don’t just blindly paste the answer back in. Read it. Understand it. Make sure it makes sense.

Congratulations, You’ve Made Your First Script

If you’ve worked through this exercise, congratulations.

You’ve made your first Script Action.

You’ve now seen how to:

  • identify the right Asana objects,
  • gather GIDs,
  • inspect task data through the API,
  • use a script inside an Asana rule,
  • update project-level data from task-level information,
  • and start thinking about Asana as a programmable operating layer.

During the webinar, we’ll move through a number of real-world use cases. We’ll move fairly quickly, so doing this pre-work will help the session make much more sense.

The bulk of the work in any Script Action project is not usually the script itself.

The real work is:

  • identifying a good use case,
  • understanding the process,
  • gathering the right GIDs,
  • designing the logic,
  • documenting what you’ve built,
  • and making sure the automation is useful rather than just shiny.

Webinar Agenda

In the webinar, we’ll cover:

  • What makes a good Script Action use case
  • Where AI Teammates and AI Studio fit in
  • What work is repetitive, structured, and ready for automation
  • Understanding regex, the secret power tool hiding in plain sight
  • Why as-built documentation matters
  • Your Custom Field Library, and why you should be a good librarian
  • Bundles of fun, and how bundles help keep things clean
  • Real-world Script Action examples

We’ll look at use cases across areas like:

  • Accounting
  • Customer and supplier invoices
  • Procurement and inventory
  • Records management across portfolios
  • Customer onboarding
  • Vendor onboarding
  • Employee onboarding
  • And maybe a tangent or two if we get time.

Final Thought

Script Actions are one of those features that reward curiosity.

You don’t need to be a full-time developer to start using them. You do need to be willing to understand your process, look at the data, and think carefully about what should happen next.

Used well, they can help turn Asana from a place where work is tracked into a place where work actually moves.

And that’s the bit I’m excited about.

See you in the webinar.

Click here to secure your spot! (opens in a new tab)

Happy scripting.

More from the blog

Essential storage remembers this choice. With your permission, Google Analytics 4 measures visits and Microsoft Clarity records interactions. These tools load only after you accept. Read our Cookie Policy.

Essential storageAlways active for site functions and your preference.
Always on