Asana is a popular project management and team collaboration tool that enables teams to organize, track, and manage their work and projects. It offers features such as task assignments, project milestones, team dashboards, and more, facilitating efficient workflow management.
This Ballerina connector is designed to interface with Asana's REST API, enabling programmatic access to Asana's services. It allows developers to automate tasks, manage projects, tasks, teams, and more, directly from Ballerina applications.
To use the Asana Connector in Ballerina, you must have an Asana account and a Personal Access Token (PAT) or OAuth2 credentials for authentication.
If you already have an Asana account, you can integrate the connector with your existing account. If not, you can create a new Asana account by visiting Asana's Sign Up page and following the registration process. Once you have an Asana account, you can proceed to create a PAT or set up OAuth2.
-
Log in to your Asana account.
-
After logging in, navigate to the Asana developer console.
-
Click on the + Create new token button.
-
Provide a name for the token and accept Asana's API terms checkbox after reading them.
-
Click on the Create token button.
-
Copy the generated token and keep it secure. You will need this token to authenticate the Asana connector.
To use the Asana
connector in your Ballerina application, modify the .bal
file as follows:
Import the ballerinax/asana
package into your Ballerina project.
import ballerinax/asana;
Create an asana:ConnectionConfig
with the obtained PAT (or OAuth2) credentials and initialize the connector with it.
asana:ConnectionConfig asanaConfig = {
auth: {
token: authToken
}
};
asana:Client asana = check new (asanaConfig);
Now, utilize the available connector operations.
record {asana:ProjectCompact[] data?;} projects = check asana->/projects();
asana:Tasks_body taskReq = {
data: {
name: "Email Marketing Campaign",
notes: "Create a new email marketing campaign for the upcoming product launch.",
workspace: "<workspaceId>",
projects: ["<projectId>"]
}
};
record {asana:TaskResponse data?;} taskCreated = check asana->/tasks.post(taskReq);
The Asana
connector offers practical examples illustrating its use in various scenarios.
Explore these examples, covering the following use cases:
- Employee onboarding process automation - Automate the onboarding process of new employees using Asana projects and tasks.
- Team workload balancer - Evaluate and balance the workload of a given team using Asana tasks and assignments.
The Issues and Projects tabs are disabled for this repository as this is part of the Ballerina library. To report bugs, request new features, start new discussions, view project boards, etc., visit the Ballerina library parent repository.
This repository only contains the source code for the package.
-
Download and install Java SE Development Kit (JDK) version 17. You can download it from either of the following sources:
Note: After installation, remember to set the
JAVA_HOME
environment variable to the directory where JDK was installed. -
Generate a Github access token with read package permissions, then set the following
env
variables:export packageUser=<Your GitHub Username> export packagePAT=<GitHub Personal Access Token>
-
Download and install Docker.
Note: Ensure that the Docker daemon is running before executing any tests.
Execute the commands below to build from the source.
-
To build the package:
./gradlew clean build
-
To run the tests:
./gradlew clean test
-
To build the without the tests:
./gradlew clean build -x test
-
To run tests against different environment:
./gradlew clean test -Pgroups=<Comma separated groups/test cases>
-
To debug package with a remote debugger:
./gradlew clean build -Pdebug=<port>
-
To debug with the Ballerina language:
./gradlew clean build -PbalJavaDebug=<port>
-
Publish the generated artifacts to the local Ballerina Central repository:
./gradlew clean build -PpublishToLocalCentral=true
-
Publish the generated artifacts to the Ballerina Central repository:
./gradlew clean build -PpublishToCentral=true
As an open-source project, Ballerina welcomes contributions from the community.
For more information, go to the contribution guidelines.
All the contributors are encouraged to read the Ballerina Code of Conduct.
- For more information go to the
asana
package. - For example demonstrations of the usage, go to Ballerina By Examples.
- Chat live with us via our Discord server.
- Post all technical questions on Stack Overflow with the #ballerina tag.