MuleSoft + Asana Series 1

Author: Eswara Pendli

Who’s not ready to make the simplest way for teams to trace their work and obtain results.


Do you know most of the time at work isn’t focused on the work? Ideally, teams spend more time on work about the work than doing “work.”

In simple terms, 61% of the work will be spent on coordination like internal communication (messaging, meetings/tracking down the knowledge, and answering the emails). But the actual work will be 39% only. We generally collaborate with Gmail/Outlook, Teams/Slack, and Drive/Dropbox channels. There is a coordination gap just like the plan & purpose of the work as we are collaborating more.

Source: McKinsey Global Institute

Recently, MuleSoft released Asana Connector in Anypoint Exchange. This connector does support the Mule 4.X Runtime version.
In this series, we’ll discuss Asana and establish the connectivity between Asana and MuleSoft by using MuleSoft’s Asana Connector.

What is Asana?

It is software that tracks all the team’s work.

In simple,

  • It is a collaboration & work management tool. Where we will use across teams & organizations.
  • It is a project & tasks management tool that helps plan, track and manage the projects.
  • It is easy to integrate with other platforms (like MS Teams & Other).
  • It supports portfolio & goal management.
  • And it’s available in web-based, mobile & desktop applications.
Why Asana?

Asana helps us to spend less time talking about work and more time getting it done. Asana helps us to know when what & who is performing the work. Communication is usually focused and actionable. We will always know the status of work happening across teams.

Structure of Asana:

  • Organization
  • Teams
  • Project
  • Tasks
  • Asana accounts are free and specific to “individuals.”
  • Asana accounts grant access to shared workspaces and organizations to collaborate more with other Asana users.
  • Each workspace & organization will have its entity like each will have unique projects, people & tasks.
  • Using a single Asana account, you can create or join multiple workspaces & organizations to collaborate more with various groups of Asana users.
  • Though each workspace and organization are separate entities, our colleagues cannot see the opposite workspaces or organizations we belong to. And we cannot see the other workspaces/organizations our colleagues belong to.
How to hook up with Asana using MuleSoft

Setup Asana Account:

  • We can easily sign up for an Asana trial account using your email address here.
  • Once account setup is completed. Now go to Profile -> My Profile Settings -> Apps and click on Manage Developer Apps to create an app as shown below:
  • Create a new app with a relevant app name.
  • Upon creation of an account, we can see the auto-generated client credentials. Update the respective callback URL at the redirect URL section as per your requirement and copy the client credentials.

Note: We have updated the local callback URL for PoC 🡪 http://localhost:8081/callback

  • That’s it. We have successfully created a client application on Asana to establish connectivity from MuleSoft.
Configuration / Connection Establishment for MuleSoft
  • Now, go to MuleSoft’s Anypoint Studio and create a new Mule project.
  • Upon creation of a new project, we can add the Asana Connector/Module using MuleSoft Exchange. Select and add the Asana Connector and click finish.
  • Once the connector is downloaded, it’s time to configure the Asana global configuration. We will establish the connection using Oauth2-Connection-Provider by providing the respective parameters,
  • We will use Asana Client App Id as consumer key and Client App secret as consumer secret.
  • We will update the respective Oauth callback configuration as configured at the Asana client application and by using default scopes to establish the connectivity with Asana.

The following parameters must configure:

Please refer the following configuration XML for the same:

<http:listener-config name=”HTTP_Listener_config” doc:name=”HTTP Listener config” doc:id=”4ea05360-9ba2-444c-bc25-a71d96f0b7e8″ >
<http:listener-connection host=”0.0.0.0″ port=”8081″ />
</http:listener-config>

<asana:config name=”Asana_Connector_Config” doc:name=”Asana Connector Config” doc:id=”cbc753d3-e102-4a9d-9628-c37bbf12d0b8″ >
<asana:oauth2-connection >
<asana:oauth-authorization-code consumerKey=”${asana.consumerId}” consumerSecret=”${asana.consumerSecret}” resourceOwnerId=”mule_demo”/>
<asana:oauth-callback-config listenerConfig=”HTTP_Listener_config” callbackPath=”/callback” authorizePath=”/authorize” externalCallbackUrl=”http://localhost:8081/callback”/>
</asana:oauth2-connection>
</asana:config>

  • Now we can create a simple flow to retrieve all the workspaces details associated with this user account using the Get Workspaces operation as shown below:
  • Now we will deploy this simple application. Upon successful deployment, we would have to perform OAuth dance for this resourceOwnerId (“mule_demo”) to gain the respective authorization to access Asana operations/resources by using the following URL as per the configuration: http://localhost:8081/authorize?resourceOwnerId=mule_demo (for demo purpose)
  • Copy the code value/access token that authorizes this resourceOwnerId (“mule_demo” ):
  • Now we can retrieve all the workspaces details associated with this user account by passing this code value as a bearer token to this API:

### Who’s not ready to Communicate in one space by doing more Integrations and Syncing with ease! ###

Stay tuned for Series-2!!

!!!!! Happy Learning!!!!!

References

https://developers.asana.com/docs/how-to-use-the-api
https://docs.mulesoft.com/asana-connector/1.0/
https://developers.asana.com/docs/object-hierarchy
https://asana.com/guide/help/workspaces/basics
https://developers.asana.com/docs/oauth
https://developers.asana.com/explorer
https://developers.asana.com/docs/rate-limits
http://www.paulmatsushima.com/posts/work-management/

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.