Free snippets for "Custom Scripts" rule action in Asana

Asana quietly released an amazing feature to Enterprise clients: the ability to use your own code in an automation to rename tasks, change fields, update goals… The possibilities are endless.

There is one pickle :cucumber: though: you need to be a developer or know how to code.

i.DO, your favorite Asana Partner, got you covered: we are sharing a free gallery of snippets you can use!

Duplicating a task, completing all subtasks, skipping week-ends, detecting a word, copy fields into subtasks… we have it all! And you want a custom code, we can also help and create it for you!

https://ido-clarity.com/asana-code-gallery

PS: at i.DO we now use this feature EVERYWHERE. It is a game changer


Bastien, Asana Expert
i.DO
(Asana Partner: Services & Licenses)

11 Likes

Fantastic resource, @Bastien_Siebman !
Thank you for putting this together - I will definitely give them a spin :smiley:

1 Like

Hey there! Questions about some of the additional code options listed.

#6: Does this automatically add all subtasks as “blocker” dependencies on the parent task?
#10 & #11: Can you explain what these do?

1 Like

#6 is indeed about blocking the main task by all subtasks when the code runs. You have to make sure you plug that code into a rule with the proper triggers.

Regarding #10, the idea is to create another task that’s dependent on the main task. Then #11 is about publishing a project status updates.

The details of what exactly is being done will depend on the actual final code that you use. We can help you do some fine tuning, or you can turn to your IT team to help you.

Hey Bastien. Quick question

I simply added a rule (for testing purposes), that when all sub tasks are complete → run script (your duplicate task script) but get the following
Encountered an error: {"name":"PromiseRejected","message":"Bad Request","stack":" at run (eval.js:11)\n"} Finished in N/A ms.

Any ideas on this. Are there any other pre-requisites or anything? The rule does run, but errors out

Thanks!

1 Like

Indeed sorry that’s a format error. The list below

"assignee, attachments, dates, dependencies, followers, notes, parent, projects, subtasks, tags"

should not have any spaces

"assignee,attachments,dates,dependencies,followers,notes,parent,projects,subtasks,tags"

Updating the document, thanks again!

1 Like

@John_Baldo seems like a weird/annoying problem that could be fixed :slight_smile: