Jump to content

Asana - Add a task automation


Recommended Posts

Setup Instructions:
1. Create a new access token on Asana and set it on the accessToken env variable [1]

2. Set your user id: use the "asana" keyword and select "My ID", then press enter to copy the gid and paste it on the "me" env variable

3. Set the workspace id: use the "asana" keyword and select "Workspaces", select the workspace you want, and paste the gid on the "workspace" env variable

 

How to use:
In order to create a task, use the "task" keyword.
The format of the input should be this: title;description
for e.g. "create a website;check the email from John and create the website according to his instructions"

In order to open the URL of the newly created task add ":" followed by a space at the end of your input, for e.g. "create a website :" or "create website;setup wordpress :"

 

Examples:
In order to assign a user to the task, you can use the "-a" flag followed by a space at the end of your input, for e.g. "create a website -a"

In order to add a project to the task, you can use the "-p" flag followed by a space at the end of your input, for e.g. "create a website -p"

In order to add a section to the task, you can use the "-s" flag followed by a space at the end of your input, make sure that the "-p" flag exists

You can also use here the open URL feature by simply add the ":" character at the end (before or after the flags), for e.g. "create a website : -a" or "create logo;use blue and grey colors -a -p :"

In order to resync data like projects, sections, or users you can use the "asana" keyword and select the desired function.

 

Text formatting:
**Bold**

To bold your message, place an asterisk on both sides of the text:

*text*

 

**New line**

To make a new line, use \n:

 

Development:
To run the script you the following command:

me=$me workspace=$workspace accessToken=$accessToken node index.js 'task title;task description'

Set the variables to your vars.

 

Optional variables:
assignee, projectId, sectionId

 

References:
[1] https://asana.com/guide/help/api/api

 

GitHub URL:
https://github.com/lacherogwu/alfred-workflows-asana-automation

 

Edited by Lachero
v3.2.1
Link to comment

Hi Lachero ! 

Thanks a lot for this workflow !!

However I'm having trouble finding the gid for "My id" and the "Workspace". See the screenshots attached.

After I chose My Id, it only shows "me" but not id behind.

Have ever encountered this kind of problem ? Is it coming from the fact that I don't have an "Enterprise account" for Asana ?

Thanks a lot for your help !673452457_Capturedecran2021-02-10a17_31_06.thumb.png.d79ad9c603d5155183bf66dee0f34282.png949722275_Capturedecran2021-02-10a17_30_18.thumb.png.c84576e55f031b75f9bc7f24a2accb75.png

Link to comment
26 minutes ago, lamartinal said:

Hi Lachero ! 

Thanks a lot for this workflow !!

However I'm having trouble finding the gid for "My id" and the "Workspace". See the screenshots attached.

After I chose My Id, it only shows "me" but not id behind.

Have ever encountered this kind of problem ? Is it coming from the fact that I don't have an "Enterprise account" for Asana ?

Thanks a lot for your help !673452457_Capturedecran2021-02-10a17_31_06.thumb.png.d79ad9c603d5155183bf66dee0f34282.png949722275_Capturedecran2021-02-10a17_30_18.thumb.png.c84576e55f031b75f9bc7f24a2accb75.png

Hello, usually from what I know, if you have didn't enter an access key in the environment settings you will not see the ID, as of now you will not see also a feedback. in your version you can try to create task using the "task" keyword and if something is not set correctly it should show you an error.

 

I also pushed a new version 3.2.1 to github, you can download the new version and it should also show feedback on the "asana" keyword.

I suggest you again to check the accessKey you entered in the environment settings, if they key is correct so everything should work fine.

 

If you face any other issues let me know 😄

 

 

Link to comment
  • 8 months later...

Hello @Lachero Thanks for putting this together. I am getting the same issues when I try to put the API in using the "asana my id" command.

 

Quote

I suggest you again to check the accessKey you entered in the environment settings

What did you mean by this? 

 

Thanks for the help and your time :)

Link to comment
  • 1 month later...
  • 3 weeks later...
  • 8 months later...
  • 1 month later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...