Batch assign tasks to a designated "role" per project

I have preset project templates defined in a Google Sheet, and when I need to create a project, I have some script set up to pull those tasks, apply due dates, assignees, etc. accordingly and send the info to Asana. Some of these tasks are always assigned to the same user, but some need to be changed based on the project.

For example: I’m in real estate, and each project is representative of one property that we are selling. For each transaction, there’s always the same marketing person, admin, operations person, and so on. However, with each transaction the Real Estate Agent that is working the deal will differ. In my Google Sheet, I have the templates set up with a “Role” column as the assignee for each task. For the ones that are assigned to “Marketing” or “Operations” it’s as simple as cross referencing with an object storing the person assigned to each role and using their email to assign the tasks in Asana.

However, since the “Agent” assigned tasks can not just be sent to the same person every time, I need to figure out a way to make that flexible. One obvious way is to pass the agent’s email into the function as a parameter, but I don’t like that. Ideally, I want a “Role List” in my Asana project where I can change the user assigned to each role and assign tasks accordingly. I know in the Overview tab of projects there is a Project roles section where you can type in an open-ended role for each user assigned to the project, so my current thought is to initially set up all of my “Agent” tasks in the project with no assignee, but instead a custom field called “Role” that just shows “Agent.” From the overview screen, when somebody is given the role of “Agent” my script would then detect this and comb through each of those tasks, assigning anything with the “Agent” tag to the user specified on the overview screen.

This just seems rather convoluted with a lot of API calls back and forth, am I overlooking a simpler solution here?

You can’t access the roles given in the overview from the API, so you would need to find another way of giving this information to your script…

1 Like