Trello is a popular web-based project management and collaboration platform developed by Atlassian, allowing users to organize tasks, projects, and workflows using boards, lists, and cards.
The ballerinax/trello
package provides APIs to connect and interact with Trello's RESTful API endpoints, enabling developers to seamlessly manage boards, lists, cards, and other Trello resources.
To use the Trello connector, you must have access to the Trello API through a Trello account and an API key and token generated from it. If you do not have a Trello account, you can sign up for one here. You can generate your Trello API key and token by following the instructions at Trello API Keys.
-
Visit the Trello powerups admin page and create a new powerup
-
Enter the required details:
- Name of your Power-Up
- Iframe Connector URL (can be a placeholder URL during development) Click “Create” to create your Power-Up.
-
Navigate to 'API Key' and click on 'Generate'
Copy and securely store your API Key.
-
Next to the API Key description, there's a link to the token. Click the link, authorize the Power-Up, and you’ll be redirected to a page displaying your OAuth token.
Copy and securely store the Token.
To use the Trello connector in your Ballerina application, update the .bal file as follows:
Import the Trello module.
import ballerinax/trello;
Create a Config.toml
file and configure the obtained credentials as follows:
key = "your_api_key"
token = "your_api_token"
Now, utilize the available connector operations.
Create a card
public function main() returns error? {
trello:PostCardsQueries cardPayload = {
idList: listId,
name: "This is a sample card"
};
trello:Card createdCard = check trello->/cards.post({}, cardPayload);
io:println("Card created: ", createdCard.name, " (ID: ", createdCard.id, ")");
}
bal run
The Trello
connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Create and retrieve a list and cards in Trello - Create a new list in a specific Trello board and retrieve its details using the list ID.
- Create, update fetch and add a label to a card in Trello - Create a new card in a Trello list and update the card's name add a label to it and view it.
-
Download and install Java SE Development Kit (JDK) version 21. 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. -
Download and install Ballerina Swan Lake.
-
Download and install Docker.
Note: Ensure that the Docker daemon is running before executing any tests.
-
Export Github Personal access token with read package permissions as follows,
export packageUser=<Username> export packagePAT=<Personal access token>
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 environments:
./gradlew clean test -Pgroups=<Comma separated groups/test cases>
-
To debug the 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
trello
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.