Can scripts use AI to branch execution based on keyword similarity?

I tried various things, but I don’t think it’s possible to process AI using a script. When I asked Asana-ai, they said it wasn’t possible. They said there is no API that allows you to use AI functions from a script.


Guidance for AI
Task Similarity Check Guidelines Purpose: This guideline establishes procedures for assessing the similarity of new tasks and taking appropriate action. This allows for task classification and efficient task management.
Procedure: 1. Check the new task: Carefully review the “Name” and “Description” of the new task. 2. Evaluate the similarity of the included strings with the “Classification Keywords” below.
Classification Keywords: ・Keywords: Safety, Health, and Transportation: Safety, Health, Disaster, Injury, No Days Off, Work Leave, Ambulance, Fire Engine ・Keywords: Quality: Defect, Nonconformity, Trouble, Defect, Breakdown
Response Method: 1. If the similarity is “Safety, Health, and Transportation,” set the custom field “Message Category” to “Safety, Health, and Transportation.” 2. If the similarity is “Quality,” set the custom field “Message Category” to “Quality.” 3. If there is no similarity: Set the custom field “Message Category” to “General Affairs and Other” and enter the reason in the comments.


Asana AI Q&A 1

  • Question: About scripts: Can you read task descriptions, compare them with specified keywords, and determine whether they are similar?
  • AI Answer:
    About Asana AI Features
    Currently, Asana’s standard features do not directly read task descriptions, automatically compare them with specified keywords, and determine similarity. However, the following Asana AI features may be relevant:
    Smart Answers: Ask Asana questions in natural language to get answers and insights about your projects.
    Smart Summaries: Extract highlights and summarize task descriptions and comments.
    Search Function: Search for tasks containing specific keywords.
    Automation Options
    Task content can be analyzed in the following ways:
    -1. Rules: Automatically process tasks based on specific conditions, but text content similarity analysis is not currently included in the standard features.
    -2. Smart Rules: Create rules using AI with natural language instructions (Advanced/Enterprise feature).

Asana AI Q&A 2

  • Question: Can I access AI features through scripts?
  • AI Answer: About the integration of scripts and Asana AI features
    Yes, it is possible to access Asana from scripts through the Asana API, but the current documentation does not clearly describe API integration specifically for AI features.
    The Asana API allows you to:
    Read information within Asana
    – Input information from outside
    – Automatically respond to changes
    However, the current public documentation does not provide details on how to directly access AI features like Smart Summaries, Smart Editor, and Smart Chat from scripts.
1 Like

Neither the Asana API nor the rule-action scripting provides any AI-related capabilities.

1 Like

IMPORTANT UPDATE: Please disregard my complex workaround detailed below. At the time I posted this, we were getting errors that “Sleep time” or “wait time” was not supported in Script Actions, so we came up with this oddball workaround that worked.

However, it appears, based on @Phil_Seeman’s helpful comment here, it appears this workaround is no longer necessary. I’m only leaving my reply here for reference so anybody who implemented my workaround can see it’s no longer necessary:


@Ka_Nishiyama - this is not possible directly the way you’ve described it, however it is possible, and can be done without the use of any external automation platforms. But, it’s quite complex to set up. I did something similar for a client a couple weeks ago.

If you wanted to do branching based on exact keyword matches, that is absolutely possible within script actions.

However, to accomplish what you are referring to, which is keyword similarity yes it would require AI, and while you can’t do that directly within a script action, you can do it with some complicated but possible hacky workarounds.

I’ll explain the concepts at a high level here and then I would encourage you to either hire/delegate to a developer, or you could reach out and my team could spec and quote this short-term deliverable for you.

At a high level, here’s what the script action needs to accomplish:

  • fetch the keywords from the specific Asana task element (custom field, description, or wherever they are)
  • simulate an automations delay in your script action (HINT: script actions don’t support delays, but you can simulate them by having them do a lengthy operation 10 or 20 times in a row before they move to the next step – as a silly example, one that you probably wouldn’t want to use, you could have it add subtasks with the digits 1 to 100 and then remove them and do it again 3 times) . I’ve used this various times and it works great.)
  • post them to an “AI PROCESSING” project as the description of a new task
  • have an AI rule in that project that checks for keyword similarity and post a structured comment, with a table, showing the results of that AI analysis
  • then have your script action check for the comment of that task that ran the AI analysis
  • then take any necessary actions.

Seems complex. It is. But it works.

If you decide you’d like us to help you, we could scope the exact process with you and provide a quote for it. But if you have an internal developer on your team that can handle it, follow the steps above and it will work.

1 Like

@Ka_Nishiyama I’m not sure I understand the reason to need the keyword comparison.

Can’t you describe each category, and let AI Studio pick the one that is the best match?

Maybe add an escape option: “unable to pick category”

1 Like

Thanks, @Jan-Rienk

I’ve made some corrections.
What do you think?

I’d group them like so for clarity:

I was thinking of adding something like this:

Description and keywords to look for per category:

  • Safety, Health, and Transportation
    – Description: {descrption of category}
    – Keywords: Health, Disaster, Injury, No Days Off, Work Leave, Ambulance, Fire Engine
  • Quality
    – etc…

The idea is that it makes it easier for the AI to understand the hierarchy.

It should understand that the bulleted list belongs to the line above it, as it ends with “:”, and the further indented bullets belong to the less indented bullets. That way it just has to look at “does it belong to this bucket” instead of having to compare the task to the same category in spread out over the instruction.

Useful shortcuts for bullet indentation:

  • Increase indent: tab
  • Decrease indent: shift+tab
1 Like

FYI, the Asana-recommended way to wait inside of a script action: Is there a way to wait until method is completed? - #15 by dbrdak

2 Likes

@Phil_Seeman - thanks so much for pointing that out. When I first tried to add a 30-second sleep time, I got an error that Script Actions currently didn’t support sleep time, so that’s why I suggested the very strange and complex workaround I proposed above. But, according to what I’m seeing in your link that you shared @Phil_Seeman, it appears this has been addressed. Thank you for posting that resource.

1 Like